Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript anythingSliderFX delay start (not speed)

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #36353
    gordon
    Member

    Hello

    Just a quick query as to whether I can have anythingSliderFX classes have a delay in the time they start from, as opposed to using the speed? Speed is cool an’ all, and I can use that effectively.. but if I wanted 4 classes on 1 slide to all run consecutively? Let’s say A, B, C and D.

    Ds easing would be visibly slower than As if I have a gap between them. Is there a way around that? Like a pause time, something?

    Thanks for any info!

    #95608
    Mottie
    Member

    Hi Gordon!

    Sadly, it isn’t possible at this time. I was trying to limit the number of options to keep it simple. But basically all the FX extension does is bind to the “slide_init” (for out effects) and the “slide_complete” (for in effects) events, so try something like this:

    $('#slider')
    .bind('slide_init', function(event, slider){
    // look in target page for element
    var el = slider.$targetPage.find('.element-d');
    if (el.length) {
    el.css({ top: '-300px' }); // get element outta sight
    }
    })
    .bind('slide_complete', function(event, slider){
    // look in current page for the element
    var el = slider.$currentPage.find('.element-d');
    if (el.length) {
    setTimeout(function(){
    el.animate({ top: '20px' }, 1000); // animate element into view
    }, 2000); // 2 second delay before animating
    }
    });
    #95610
    gordon
    Member

    Thanks, Mottie.

    Off point here (if you’re still around), but could you suggest a good online course for me to learn writing js? I know it’s a large spectrum and there’s lots around.. but if you’ve noted one as being particularly good at easing js noobs in to a good understanding, I’ll take that up.

    I’m still very much at copy and paste stage.. mostly finding what I need from stackoverflow and jsfiddle, or jquery blogs. Adjusting here and there, but mostly out of numerous trial and errors.. need to learn to write now.

    Thanks for the update (and this awesome slider)!

    #95614
    Mottie
    Member

    Hi Gordon!

    I may not be the best person to ask about learning javascript/jQuery, because I’m a learn by example/experimentation kind of person. I am completely self-taught, so I don’t have any college course background in programming. I started learning javascript when I wanted to add functionality to websites, but completely switched over to jQuery when I discovered it. So ask me to write a program to grab a JSON file in pure javascript and you’ll see me stare at you like a deer in headlights; but no problem for me in jQuery. :P

    So, if you want better ideas, check out this StackOverflow answer.

    I would also recommend looking at other people’s code snippets or even plugins to figure out how something is done. And also, try to troubleshoot problems that other people have on StackOverflow, it will definitely sharpen your skills. If nothing else, someone else’s answer may give you a different perspective.

    #95619
    gordon
    Member

    Huh, that’s surprising. Thanks for the answer.

    I guess I’m not all bad then.. Just feel I should know more a year down the line (feeling of cheating a bit). Not up to writing a slider from scratch (esp. w/ with so many cool functions). StackOverflow’s offline now.. but I’ll check that link.

    I’ll definitely take up pushing to troubleshoot StackOverflows questions. Maybe even jsfiddle them if I get it right ;)

    Thanks, Mottie!

    Regards

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.