• CarolineElisa

    (@carolineelisa)


    Hi there,

    I wish a link to jump the slider to a particular slide, but I can’t get it to work as expected.

    Here is the page: http://www.storybox.co.nz/2012/test-project

    The content of final slide has the id of video:
    <iframe src="http://player.vimeo.com/video/22508028?title=0&byline=0&portrait=0" frameborder="0" width="800" height="450" id="video"></iframe>

    In the page I have included a link to #video:
    <a href="#video">Test link</a>

    The link does not go to the slide. However, it does of course append to the url and if I refresh the page, it jumps to the slide.

    Can you help? Thanks!

    http://wordpress.org/extend/plugins/anythingslider-for-wordpress/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Mottie

    (@mottie)

    Hi CarolineElisa!

    It seems to work for me: http://www.storybox.co.nz/2012/test-project/#video

    Edit: Oh duh, you meant the link on the page. Just add this bit of code:

    jQuery('a[href*="#video"]').click(function(){
        jQuery('.anythingBase').anythingSlider(4);
    });

    It doesn’t use #video because the video extension replaces the id of the video on the iframe. So either target slide 4 or the id or class name of the element wrapping the iframe.

    Thread Starter CarolineElisa

    (@carolineelisa)

    Thanks Mottie!

    I want to make it easy for my client to add these links, so I think it is best to wrap the slide in an element with an id of “video”, rather than use jQuery…

    It now works: http://www.storybox.co.nz/2012/test-project/

    However, after jumping to the video slide, the slideshow then goes to the next slide as normal, but then stays on that slide while cycling through all the thumbs before resuming the slideshow…

    This is a bit unexpected. If it can’t be easily fixed, I would prefer to stop the slideshow after clicking the “#video” link.

    What do you suggest?

    Thanks again,
    Caroline

    Plugin Contributor Mottie

    (@mottie)

    Hmm, well now the link isn’t associated with the slider at all. Maybe the next best solution would be to add the code, but link to the video id instead of a specific slide?

    jQuery('a[href*="#video"]').click(function(){
        jQuery('.anythingBase').anythingSlider( this.hash );
    });

    The reason I didn’t do this in the first place was because of the HTML. Now with the code above, you can make links to multiple videos, all of which will need a wrapper with an id that matches the href:

    <a href="#video1">First video</a>
    <a href="#video-two">Second video</a>
    <a href="#video99">Better than video 98</a>
    Thread Starter CarolineElisa

    (@carolineelisa)

    Hi again Mottie! Sorry to take to so long to reply. This project got put on hold.

    The code is mostly working, just one thing…

    When I click the link and the slideshow is in transition, it still goes to the slide it was going to anyway.

    Any way to override this?

    Here is the page: http://www.storybox.co.nz/wordpress2/2012/after-light

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: AnythingSlider for WordPress] Jumping to a particular slide’ is closed to new replies.