Giter Site home page Giter Site logo

nrajasiddharthan / jquery-backdetect Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ianrogren/jquery-backdetect

0.0 1.0 0.0 35 KB

jQuery backDetect is a jQuery plugin that is used to determine when a user clicks the back button and fire a callback function.

HTML 19.03% JavaScript 21.23% CSS 59.74%

jquery-backdetect's Introduction

backDetect

Determining when a user clicks their browser's back button has never been easier with this jQuery plugin. With a quick easy install and minimal set up work you'll be firing callback functions on back button declarations in no time.

View a demo of it here.

Installation


  • Download the latest release from here (or npm install jquery-backdetect or bower install jquery-backdetect)
  • Copy either jquery.backDetect.js or jquery.backDetect.min.js to your scripts folder
  • Include the script after you call on jQuery

Browser Support

| Chrome logo | Firefox logo | Internet Explorer logo | Safari logo | |:---:|:---:|:---:|:---:|:---:| | All ✔ | All ✔ | 8+ ✔ | All ✔ |

Basic Usage

Can append to any element or class:

<script src='backdetect.jquery.js'></script>
<script>
		$(window).load(function(){
			$('body').backDetect(function(){
				// Callback function
			});
		});
</script>

Custom Options

You can set a delay intiate the back detect. Very similar to setting the time in setTimeout:

<script src='backdetect.jquery.js'></script>
<script>
		$(window).load(function(){
			$('body').backDetect(function(){
				// Callback function
			});
		}, 1000); // <- 1 second delay
</script>
Settings Default Value Description
delay
delay: 0
The length of time it takes for the backDetect plugin to fire and monitor when a user hits the back button.

Change Log

1.0.2 Added backDetect to npm and bower repos.

1.0.1 Removed the need for the 1x1.png image for IE.

Licence

		                    __
		            _,..,_ (, )
		         .,'      `,./
		       .' :`.----.': `,
		      :   : ^    ^ :   ;
		     :   :  6    6  :   ;
		     :   :          :   ;
		     :   :    __    :   ;
< MIT >       :   `:'.--.`:'   ;
		       `.  : o  o :  .'
		        :   `----'   :  
		        : .  :'`:  . :
		        `.:.'    `.:.' 

jquery-backdetect's People

Contributors

ianrogren avatar irogren avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.