Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: minor Feature Request for a DD-Script

  1. #11
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    I have an idea to interject. I'm not sure if this would help too much, but I think it might solve the problem:

    You can use a variable to store whether it should be moving.
    onmouseover store it as 1
    onmouseout store it as 0

    This could be done in several ways but the basic idea should be fairly simple, actually, except that you'll have to keep track of that variable throughout the page.

    The one final complication is that you can do other things to move your mouse aside from "onmouseout" such as changing windows (keyboard shortcut) then returning with your mouse in a new position. Not sure what to suggest there.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  2. #12
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by kobo1d View Post
    check your inbox as you got an PM
    Um, nothing I can see. djr33's idea might work out, but I'm still a bit curious, why not use:

    http://www.enova-tech.net/eng/lab/jMyCarousel

    It's free and already does what you want.
    - John
    ________________________

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

  3. #13
    Join Date
    Jun 2007
    Posts
    64
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    hey! thx for ya input djr.

    @john: well i dont use it because it does not support external controls...
    i need a pagination-like navigation through the carousel...


    how could i realise such an loop where it checks constantly for mouseover/mouseout ?!

  4. #14
    Join Date
    Jun 2007
    Posts
    64
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Cool

    well after playing around sum time i realised that the timing problem could have sumthing todo with the carousel's config parameters...

    as i found this line:

    Code:
    panelbehavior: {speed:2572, wraparound:false, persist:false},
    as you can see i set the speed to 2572... now i thought whats gonna happen if i put the interval lenght also to a value around 2sec...

    so i ended up with this code:

    Code:
    		var timerLeft;
    		config.$leftnavbutton.hover(function(){ //assign nav button event handlers
    			timerLeft = setInterval(slideLeft, 2222);    
    		}, function() {
      			clearInterval(timerLeft);
    		});
    
    		function slideLeft() {
      			stepcarousel.stepBy(config.galleryid, -config.defaultbuttons.moveby);
    		}
    
    
    		var timerRight;
    		config.$rightnavbutton.hover(function(){ //assign nav button event handlers
    			timerRight = setInterval(slideRight, 2222);    
    		}, function() {
      			clearInterval(timerRight);
    		});
    
    		function slideRight() {
      			stepcarousel.stepBy(config.galleryid, config.defaultbuttons.moveby);
    		}
    and voila the timings are working... as soon as i unhover the carousel stops :-)


    theres just one thing now which is a little nasty, the fact i have to hover for 2 secs before the carousel starts with it's first step, but i think i can live with that

    or if you have an idea how i could fire the first step faster without changing the following step interval's, then i would be very happy to hear it!


    once again thx to you john and djr for your time and a nice weekend i wish





    *EDIT*


    this is the final code i have now which solves also the first 2sec waiting..
    it now instantly starts sliding and keeps sliding until the exact moment i unhover:

    Code:
    		var timerLeft;
    		config.$leftnavbutton.hover(function(){ //assign nav button event handlers
    			timerLeft = setInterval(slideLeft, 2222);    
    		}, function() {
      			clearInterval(timerLeft);
    		});
    
    		function slideLeft() {
      			stepcarousel.stepBy(config.galleryid, -config.defaultbuttons.moveby);
    		}
    
    		
    		config.$leftnavbutton.bind('mouseover', function(){ //assign nav button event handlers
    			stepcarousel.stepBy(config.galleryid, -config.defaultbuttons.moveby)
    		})
    		config.$rightnavbutton.bind('mouseover', function(){ //assign nav button event handlers
    			stepcarousel.stepBy(config.galleryid, config.defaultbuttons.moveby)
    		})		
    
    
    		var timerRight;
    		config.$rightnavbutton.hover(function(){ //assign nav button event handlers
    			timerRight = setInterval(slideRight, 2222);    
    		}, function() {
      			clearInterval(timerRight);
    		});
    
    		function slideRight() {
      			stepcarousel.stepBy(config.galleryid, config.defaultbuttons.moveby);
    		}

    its maybe not that beautiful, but works like a charm ;-)

    everythings done with that script... (can be tagged as resolved)
    Last edited by kobo1d; 05-15-2010 at 01:29 PM. Reason: answered myself :)

  5. #15
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Code:
    		var timerLeft;
    		config.$leftnavbutton.hover(function(){ //assign nav button event handlers
    			slideLeft();
    			timerLeft = setInterval(slideLeft, 2222);    
    		}, function() {
      			clearInterval(timerLeft);
    		});
    
    		function slideLeft() {
      			stepcarousel.stepBy(config.galleryid, -config.defaultbuttons.moveby);
    		}
    
    		var timerRight;
    		config.$rightnavbutton.hover(function(){ //assign nav button event handlers
    			slideRight();
    			timerRight = setInterval(slideRight, 2222);    
    		}, function() {
      			clearInterval(timerRight);
    		});
    
    		function slideRight() {
      			stepcarousel.stepBy(config.galleryid, config.defaultbuttons.moveby);
    		}
    - John
    ________________________

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

  6. The Following User Says Thank You to jscheuer1 For This Useful Post:

    kobo1d (05-15-2010)

  7. #16
    Join Date
    Jun 2007
    Posts
    64
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    ah i see ! that looks much nicer then just open another function..
    i learned much again today :-)

    thanks john im going to put some credits to you in my source code comments once my page is public !!


    so now thats how my construct looks in the end:

    Code:
                    var timerLeft;
    		config.$leftnavbutton.hover(function(){ //assign nav button event handlers
    			slideLeft();
    			timerLeft = setInterval(slideLeft, 2572);    
    		}, function() {
      			clearInterval(timerLeft);
    		});
    
    		function slideLeft() {
      			stepcarousel.stepBy(config.galleryid, -config.defaultbuttons.moveby);
    		}
    
    
    		var timerRight;
    		config.$rightnavbutton.hover(function(){ //assign nav button event handlers
    			slideRight();
    			timerRight = setInterval(slideRight, 2572);    
    		}, function() {
      			clearInterval(timerRight);
    		});
    
    		function slideRight() {
      			stepcarousel.stepBy(config.galleryid, config.defaultbuttons.moveby);
    		}

    cheers

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
  •