Results 1 to 5 of 5

Thread: DD ScrollSpy Menu | Automatic scrolling possible?

  1. #1
    Join Date
    Jul 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default DD ScrollSpy Menu | Automatic scrolling possible?

    1) DD ScrollSpy Menu

    2) http://www.dynamicdrive.com/dynamici...ollspymenu.htm

    3) Describe problem:

    Hello Forum,

    has anyone an idea how to realize an automatic scrollfunktion in jQuery?

    This script ist wonderful!

    Thanks a lot for feedback

    LucioPerca

  2. #2
    Join Date
    Aug 2004
    Posts
    9,878
    Thanks
    3
    Thanked 962 Times in 951 Posts
    Blog Entries
    15

    Default

    Hmm do you mean have the script automatically scroll to the various breaking points set by Spy Menu on its own every x seconds?
    DD Admin

  3. #3
    Join Date
    Jul 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi,

    yes, that would be really desirable.

    Do you have a Idde how this problem could be solved?

    Thank you very much

    lucioperca

  4. #4
    Join Date
    Aug 2004
    Posts
    9,878
    Thanks
    3
    Thanked 962 Times in 951 Posts
    Blog Entries
    15

    Default

    Using the invocation code of demo #1 on the script page as illustration, the code in red that follows will automatically trigger the going to of the various sections referred to inside the spy menu every x seconds. Clicking anywhere on the page cancels this cycling:

    Code:
    <script>
    
    jQuery(function($){ // on document load
    	$('#horizontalmenu').ddscrollSpy({ // initialize first demo
    		scrolltopoffset: -50
    	})
    
    	var $targets = $('#horizontalmenu').find('a[href^="#"]')
    	var cur = 0
    	var ddspytimer1 = setInterval(function(){
    		$targets.eq(cur).trigger('click.goto')
    		cur = (cur < $targets.length - 1)? cur+=1 : 0
    	}, 3000)
    	$(document).on('click', function(){
    		clearInterval( ddspytimer1 )
    	})
    	
    
    
    </script>
    Change "#horizontalmenu" to the ID of your spy menu, and 3000 to the desired pause (in milliseconds).
    DD Admin

  5. #5
    Join Date
    Jul 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks a lot.

    This solution works perfectly!

Similar Threads

  1. Automatic scrolling layers?
    By lowmarklow in forum JavaScript
    Replies: 17
    Last Post: 03-24-2010, 01:19 AM
  2. Scrolling Problem. Message doesnt scroll on page scrolling
    By mrsea001 in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 02-02-2009, 11:00 AM
  3. Jim's DHTML Menu V5.7 - getting vertical menu to follow scrolling page
    By tech-woman in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 08-17-2005, 01:10 PM
  4. Switch Menu - FrontPage natigation automatic updates
    By bobalston in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 01-08-2005, 06:21 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
  •