0

I feel like this has already been answered and implemented, but I cannot figure out the right terms or keywords to find it.

I'm using Scrollable as a subnav of sorts here: http://www.thepit-raleigh.com/press/

It shows 5 items at a time. How do I make it that the current page's link/image in the scrollable is visible when I'm on that given page.

Example, the 6th page/link (http://www.thepit-raleigh.com/press/herald-sun/) currently does not show when on that page as it's the 6th item in the scrollable.

Thanks in advance, Keefer

1 Answer 1

1

You should be able to use the seekTo(index, speed) function. eg:

<script>
    $(window).load(function() {
        var api = $(".subnavScrollable").data("scrollable");
        api.seekTo(5, 1000);    
    });
</script>
Sign up to request clarification or add additional context in comments.

3 Comments

Thanks so much, Chris. This will absolutely work for that given page. Long term, I'd like to be able to add something that dynamically moves the scrollable based on the page's index. Do you know what I mean? Some math that takes the page's index to determine the seekTo >5 but < 10, seekTo 5, > 10 but < 15, seekto 10, etc.
You just need to be able to map the id in the url eg herald-sun to the index in the array, eg. 5. Then you can just replace the 5 in the code above with the auto derived index. You could do this with JS, but it would probably be easier on the server side if you can do this.
Makes sense, but is definitely a bit beyond my skill set. Doing it server side, I could do something in PHP. Each of those press pages has a unique page variable, so wondering if I could hook into those somehow.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.