Results 1 to 2 of 2

Thread: Lightbox Script that appears after a specific duration

  1. #1
    Join Date
    Feb 2013
    Location
    India
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Lightbox Script that appears after a specific duration

    Dear All,


    I'm looking for a script that can be implemented sitewide and a lightbox appears when the user stays for more than 30 seconds on the website or on any page,
    I found this one but it is on body load event http://visuallightbox.com/rq/automat...he-page-r.html

    Please help me out guys, Its urgent

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,978
    Thanks
    43
    Thanked 3,195 Times in 3,157 Posts
    Blog Entries
    12

    Default

    Something like that can be done with any lightbox type script. The exact coding varies, and that script can do it in other ways. That said, taking the code given there, all you would need to do is to lengthen the timeout to 30 seconds:

    Code:
    <script type="text/javascript">
            var started;
      function showLightBox() 
      { 
        if (started) return;
        started = setTimeout(function(){
            Lightbox.start(document.getElementById('firstImage'));
            started;
        }, 30 * 1000);
      }
    </script>
    I would skip the body onload bit and use this version:

    Code:
    <script type="text/javascript">
    (function($){
    	var started;
    	function showLightBox(){ 
    		if (started) return;
    		started = setTimeout(function(){
    			Lightbox.start(document.getElementById('firstImage'));
    			started = true;
    		}, 30 * 1000);
    	}
    	$(window).load(showLightBox);
    })(jQuery);
    </script>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Similar Threads

  1. Determine the Video Duration
    By cancer10 in forum PHP
    Replies: 2
    Last Post: 04-13-2011, 02:41 AM
  2. Magnify duration not working
    By underbar in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 03-18-2010, 12:28 PM
  3. Lightbox image appears low on page
    By seabird in forum Dynamic Drive scripts help
    Replies: 5
    Last Post: 11-25-2009, 10:57 AM
  4. get day duration from pair dates
    By sabahan in forum PHP
    Replies: 4
    Last Post: 09-16-2009, 02:08 PM
  5. Sticky Note Script: How often it appears?
    By jokajon00 in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 04-16-2009, 01:58 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •