-1

I need to be able to ask users for help if they have been sitting idle on my php site for at least 30 seconds. I have the popup made and styled. It is on a page that currently uses a button to show the popup(for testing purposes). But now I need to remove the button and put in place some kind of javascript or php to open the modal after 30 seconds of user inactivity.

Here is some of the page that has the button to display the modal popup (I'm assuming this is where I would tell the site to wait for inactivity):

<body onload="javascript:fg_hideform('fg_formContainer','fg_backgroundpopup');">
<p>
This is an example page showing how to add the popup contact form to your website.
Click on the button below to open the popup.
</p>
<p>
<a href='javascript:fg_popup_form("fg_formContainer", "fg_form_InnerContainer","fg_backgroundpopup");'>
<img border='0' src='contact-us-button.png' width='213' height='39' /></a>
</p>

The page also includes the 2 files necessary to show and submit the popup contact form. I will show the code for those if it is necessary. Thank you so much!

Note: I found this plugin: http://www.erichynds.com/jquery/a-new-and-improved-jquery-idle-timeout-plugin/ but I'm not sure how to use it to keep a modal from being disabled once the mouse moves. I need a user to be able to fill out the contact form so it can be submitted.

I also tried using some javascript code from another post on stackoverflow but I am really really bad with javascript and have no clue what to do here.

Jamie
  • 1,579
  • 8
  • 34
  • 74
  • Possible duplicate: http://stackoverflow.com/questions/667555/detecting-idle-time-in-javascript-elegantly – Matt Stauffer Oct 16 '12 at 15:16
  • I don't mean to sound like a dupe. I saw that post yesterday, but since I didn't feel like it addressed my issue, I posted this. I don't want anything to disappear when the mouse moves. I need the popup to stay on the page once it is there. – Jamie Oct 16 '12 at 15:18

1 Answers1

0

does

<script type="text/javascript">
   setTimeout(function() {
     fg_popup_form("fg_formContainer", "fg_form_InnerContainer","fg_backgroundpopup");
   }, 30000);
}
</script>

solve the problem?

davidkonrad
  • 83,997
  • 17
  • 205
  • 265
  • Why yes it does. Thanks for the easy answer on your part! And thank you for not treating a n00b javascripter like a duma$$ :D – Jamie Oct 16 '12 at 15:24