Stuart Loxton

Coding on the nightlies

jQuery Pushup

Overview

Current Version:1.0.0

jQuery pushup is a port for jQuery of Nick Stakenburg’s pushup I’ve tried to keep it as true to the original as possible but take advantage of jQuerys features to reduce file bloat + repetition of things (uses jQuerys fade instead of the one taken from prototype).

Download

Installation

Download jQuery pushup and place the CSS, JS and images where needed. If you use a different file structure than the one provided than make sure you change the image URL in jquery.pushup.js. Include pushup.css and jQuery + jquery.pushup.js and then sit back and admire. If you feel the need to change stuff than below is more information.

    
        <script src="js/jquery-1.2.6.min.js" type="text/javascript">
        <script src="js/jquery.pushup.js" type="text/javascript">
        <link rel='stylesheet' type='text/css' href='css/pushup.css' />
    

DO NOT rename jquery.pushup.js, it’s file name is used inside the script.

Options

To change the options open up js/jquery.pushup.js where the beginning of the file will have some options you can change.

  • appearDelay: Delay in seconds before Pushup fades in.
  • fadeDelay: Delay in seconds before Pushup fades out.
  • images: Location of the images relative to jQuery.pushup.js (absolute URL’s are allowed; both http:// and /)
  • message: The update message users will see when their browser needs an update.
  • reminder.hours: Time in hours used when clicked on the reminder message.
  • reminder.message: The reminder message, #{hours} will be replaced by reminder.hours.
  • Bonus jQuery.pushup.browsers is an easier way to change minimum browser versions.

Functions

  • jQuery.pushup.init(): This is called on document load, it tests to see if a pushup message should be shown and if so then shows one.
  • jQuery.pushup.show([browser, options]): Shows the pushup message, you can overwrite the browser shown by using the browser: String parameter.
  • jQuery.pushup.hide(): Hides currently shown pushup message.
  • jQuery.pushup.setReminder(hours): Set a cookie that prevents pushup from showing for hours amount of time.
  • jQuery.pushup.reserReminder(): Resets the reminder time so that Pushup will show up on the next visit, if required.

More:

If you don’t want to have the jQuery.pushup.init() called on DOM ready then remove it from the bottom of jquery.pushup.js.