SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru Todd Temple's Avatar
    Join Date
    Mar 2005
    Location
    Tennessee
    Posts
    790
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Troubles With Multiple Instances Of A jQuery Slider

    I have added the Flowplayer jQuery scrollable slider to the web page linked below and I am trying to add more than one instance of the slider to that page. So essentially three galleries. Can someone figure out how to rewrite the jQuery function to accommodate the additional scrollable items on the page?

    LINK-
    Creative Cakery - Karns Tennessee


    Thanks in advance!
    Todd
    Todd Temple > T2 Design

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,526
    Mentioned
    83 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by Todd Temple View Post
    Can someone figure out how to rewrite the jQuery function to accommodate the additional scrollable items on the page?
    The script code doesn't need to change at all, The problem is in how your HTML code is structured.

    When scrollable looks around for your prev/next buttons, it goes to the parent of div.scrollable and checks there. On your current page design, that means it searches div.full which contains all three. That's why you're experiencing your problem.

    The solution is to wrap each prev/scrollable/next section inside their own container, so that scrollable will only find the one appropriate prev/next when it goes searching for them.

    Code:
    <div>
        <a class="prev browse left"></a> 
        <div class="scrollable">
            <!-- content here -->
        </div>
        <a class="next browse right"></a> 
    </div>
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Guru Todd Temple's Avatar
    Join Date
    Mar 2005
    Location
    Tennessee
    Posts
    790
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by paul_wilkins View Post
    The solution is to wrap each prev/scrollable/next section inside their own container, so that scrollable will only find the one appropriate prev/next when it goes searching for them.
    Sweet! Thanks so much for the fix but most of all for the explanation. That makes sense. I can't thank you enough!

    Todd
    Todd Temple > T2 Design


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
  •