How to trigger my pop up if the users mouse is idle for 1minute???

How to trigger my pop up if the users mouse is idle for 1minute???

Hi Guys,

I'm really new to jquery but trying to learn.

I have successfully managed to get a pop up dic with a faded black background to trigger when a link is clicked but i really need to trigger the pop up if the users mouse is idle for 1 minute.

I found this  Click Here which looks like the timer idle script but i cannot figure out how to implement it with my script.

If anyone knows how please can you help me out...

heres the .js file i have already

  1. var $j = jQuery.noConflict();

  2. $j(document).ready(function() {
  3. //When you click on a link with class of poplight and the href starts with a # 
  4. $j('a.poplight[href^=#]').click(function() {
  5.     var popID = $j(this).attr('rel'); //Get Popup Name
  6.     var popURL = $j(this).attr('href'); //Get Popup href to define size

  7.     //Pull Query & Variables from href URL
  8.     var query= popURL.split('?');
  9.     var dim= query[1].split('&');
  10.     var popWidth = dim[0].split('=')[1]; //Gets the first query string value

  11.     //Fade in the Popup and add close button
  12.     $j('#' + popID).fadeIn().css({ 'width': Number( popWidth ) }).prepend('');

  13.     //Define margin for center alignment (vertical   horizontal) - we add 80px to the height/width to accomodate for the padding  and border width defined in the css
  14.     var popMargTop = ($j('#' + popID).height() + 20) / 2;
  15.     var popMargLeft = ($j('#' + popID).width() + 20) / 2;

  16.     //Apply Margin to Popup
  17.     $j('#' + popID).css({
  18.         'margin-top' : -popMargTop,
  19.         'margin-left' : -popMargLeft
  20.     });

  21.     //Fade in Background
  22.     $j('body').append('<div id="fade"></div>'); //Add the fade layer to bottom of the body tag.
  23.     $j('#fade').css({'filter' : 'alpha(opacity=80)'}).fadeIn(); //Fade in the fade layer - .css({'filter' : 'alpha(opacity=80)'}) is used to fix the IE Bug on fading transparencies 

  24.     return false;
  25. });

  26. //Close Popups and Fade Layer
  27. $j('a.closebtn, #fade, a.callback').live('click', function() { //When clicking on the close or fade layer...
  28.     $j('#fade , .popup_block').fadeOut(function() {
  29.         $j('#fade').remove();  //fade them both out
  30.     });
  31.     return false;
  32. });
  33. });
    • Topic Participants

    • dan