Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: minor Feature Request for a DD-Script

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

    Arrow minor Feature Request for a DD-Script

    hey there !!

    1) Script Title:
    Step Carousel Viewer v1.8

    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...epcarousel.htm

    3) Describe problem:
    well it isnt really a problem.. more a little feature request...
    the script has nav-buttons left and right and the action is only happing if you click it..
    now i tried to make it also mouseover and changed the function from "click" to "mouseover"...
    but then it only does the action once per mouse-in.. if i want to repeat the action i have to move-out the mouse and back in again...
    but i would like to have it continiously! is there any chance somebody can help me please ?!

    i see that the script has also an autostep function...
    maybe its possible to change the script so while mouseover the nav-buttons it starts the autpstep-loop until im moving the mouse out again (just an idea)

    in the end it should work like here: http://www.enova-tech.net/eng/lab/jMyCarousel (mouseover action instead of need-to-be-clicked)

    i would really appriciate a helping hand!!


    thx alot in advance

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

    Red face

    or can somebody plz tell me how i can unpack the script,
    so i can read it better and do the manipulation myself (maybe) :-)

    i tried http://jsbeautifier.org but it didnt work after the unminify..


    thx

  3. #3
    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

    The script isn't packed.
    - John
    ________________________

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

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

    Default

    then its minified ??

    at least its really hard to read if brackets and line-breaks arent present...
    *edit: i didnt mean brackets.. i ment the indent.. :-)


    what can i do there ?!
    Last edited by kobo1d; 05-12-2010 at 09:16 AM. Reason: my english again...

  5. #5
    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

    Oh, you must mean jQuery. You don't want to edit that. At least it would be better not to. If you want a non-minified version of it, save it from this link:

    http://ajax.googleapis.com/ajax/libs....3.2/jquery.js

    But the script you should be editing is more likely the:

    stepcarousel.js

    Which is also available on the demo page.
    - John
    ________________________

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

  6. #6
    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

    You know, the JMyCarousel script you linked to is also jQuery based and free, why not use that one?

    Anyways, if you want to use the DD script, I'm thinking (untested) replace in the stepcarousel.js file:

    Code:
    		config.$leftnavbutton.bind('click', function(){ //assign nav button event handlers
    			stepcarousel.stepBy(config.galleryid, -config.defaultbuttons.moveby)
    		})
    		config.$rightnavbutton.bind('click', function(){ //assign nav button event handlers
    			stepcarousel.stepBy(config.galleryid, config.defaultbuttons.moveby)
    		})
    with:

    Code:
    		config.$leftnavbutton.hover(function(){ //assign nav button event handlers
    			$(this).data('hover', setInterval(function(){stepcarousel.stepBy(config.galleryid, -config.defaultbuttons.moveby);}, 1000));
    			}, function(){
    			clearInterval($(this).data('hover'));
    		})
    		config.$rightnavbutton.hover(function(){ //assign nav button event handlers
    			$(this).data('hover', setInterval(function(){stepcarousel.stepBy(config.galleryid, config.defaultbuttons.moveby);}, 1000));
    			}, function(){
    			clearInterval($(this).data('hover'));
    		})
    Barring any typos on my part, and as long as the data construct can be used that way, it should work. If not, and you want more help:

    Please post a link to a page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

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

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

    kobo1d (05-14-2010)

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

    Default

    hey john!

    your code is working pretty sweet and it was exactly what i was looking for..
    i just changed the 1000ms to 10ms so its reacting faster..

    thank you again for your time!


    *edit*

    but there is one problem now:

    if i hover the nav-button the script is moving, but its not really accurate like when i unhover the nav-button, its still sliding...
    so i think it counts to many steps while im on hover...

    i would need it to be like this ->

    i go hover, the script is moving (which takes about 3 secs per visual step)
    and then after one step is done it checks again if im still on hover and then add another step...etc..

    because for example im on hover for 7 seconds and the script did only about 2 visual steps,
    in the code it allready calculated the next 7 steps and continues moving until they are all done....
    and does not accuratly stops moving when i go un-hover...


    i hope you understand what i mean...



    plz help me once again john!! :-)

  9. #8
    Join Date
    Jun 2007
    Posts
    64
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    i need to correct myself there...

    after a hover (no matter how long it did take) the script moves through until the end and there it hangs...
    i cant navigate to anywhere else... it seems like it doesnt clear the function on un-hover

  10. #9
    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

    I was afraid of that. I think it's because I was getting too cute using the data construct in that manner (to hold a reference to the interval). Here's a version using the classic method for that. It should fix the problem:

    Code:
    		config.$leftnavbutton.hover(function(){ //assign nav button event handlers
    			config.lefttime = setInterval(function(){stepcarousel.stepBy(config.galleryid, -config.defaultbuttons.moveby);}, 10);
    			}, function(){
    			clearInterval(config.lefttime);
    		})
    		config.$rightnavbutton.hover(function(){ //assign nav button event handlers
    			config.righttime = setInterval(function(){stepcarousel.stepBy(config.galleryid, config.defaultbuttons.moveby);}, 10);
    			}, function(){
    			clearInterval(config.righttime);
    		})
    But it's possible the config object might not be available in the way I'm anticipating. Or it could be that 10ms is too brief, in that by the time we clear the interval, too many have built up. But that last is unlikely.

    Try the above, and if there are still problems give me a link to the page that is using the above code.
    - John
    ________________________

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

  11. #10
    Join Date
    Jun 2007
    Posts
    64
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    hey john!!

    thanks again for your input.. i tried it and it ends up in nearly the same result..
    it is sliding until the end of the carousel.. BUT after that it can be called again...
    so it does not hang up in the end, but its still moving without being hover, once its started :-(

    i think the problem is that once we hover, the function starts and repeats until its done and does not stop once we move out the mouse again... like when i put 10ms its going stepbystep every 10ms and if i put 1000ms then its going stepbystep every 1 sec, but on unhover the interval isnt destroyed..

    thats just what i think, dont see this as professional opinion :-)


    check your inbox as you got an PM

    thx again

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
  •