Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7619495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:42:05+00:00 2026-05-31T03:42:05+00:00

I’m trying to create a jQuery content slider that will eventually look like this

  • 0

I’m trying to create a jQuery content slider that will eventually look like this old 37Signals tourpage for Basecamp: http://cl.ly/2K2l1e010w0b3q1g261N (sadly, they changed the site TODAY when the updated Basecamp).

I basically want to have multiple content sliders on one page. Currently clicking the links in one sidebar makes both content areas slide.

And the fiddle: http://jsfiddle.net/saltcod/dm2dn/

Thanks for the help

Terry

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T03:42:06+00:00Added an answer on May 31, 2026 at 3:42 am

    Something tells me there’s a cleaner way to do this, however the following works. It finds the index of the link clicked, and then does the slider animation based on that. jsFiddle example.

    jQuery:
    //handle nav click
    $(“.nav a”).click(function(e) {

        //stop browser default
        e.preventDefault();
    
        //remove on states for all nav links
        $(".nav a").removeClass("on");
    
        //add on state to selected nav link
        $(this).addClass("on");
    
        //set margin of slider to move
        if ($(".nav a").index(this) <= 4) {
            $(".slider:eq(0)").animate({
                marginLeft: margins[$(this).attr("href").split("#")[1]]
            });
        } else {
            $(".slider:eq(1)").animate({
                marginLeft: margins[$(this).attr("href").split("#")[1]]
            });
        }
    });​
    

    Note that the feeling I have about an easier way probably involves changing the layout and adding other elements to wrap the content separately.

    UPDATE

    Here’s new jQuery to handle any number of groups and links:

    //handle nav click
    $(".group a").click(function(e){
    
        //stop browser default
        e.preventDefault();
    
        //remove on states for all nav links
        $(".nav a").removeClass("on");
    
        //add on state to selected nav link
        $(this).addClass("on");
    
        //set margin of slider to move
        $(this).parents('.group').find('.slider').animate({
            marginLeft: margins[$(this).attr("href").split("#")[1]]
        });                    
    });
    

    jsFiddle example. The jQuery changes are minor and the only HTML changes were wrapping each group of list/divs in a wrapper div with the class of group like this:

    <div class="group">
        <ul class="nav">
            <li class="thumb1"><a href="#panel1" title="Panel 1">Panel 1</a></li>
            <li><a href="#panel2">Panel 2</a></li>
            <li><a href="#panel3">Panel 3</a></li>
            <li><a href="#panel4">Panel 4</a></li>
            <li><a href="#panel5">Panel 5</a></li>
        </ul>
        <div class="panels">
            <div class="slider">
                <div id="panel1">
                    <p>From this day forward, Flight Control will be known by two words:
                    &#39;Tough&#39; and &#39;Competent.&#39; </p>
                    <p>It&#39;s just mind-blowingly awesome. I apologize, and I wish I was
                    more articulate, but it&#39;s hard to be articulate when your mind&#39;s
                    blown—but in a very good way.</p>
                </div>
                <div id="panel2">
                    <p>From this day forward, Flight Control will be known by two words:
                    &#39;Tough&#39; and &#39;Competent.&#39; Tough means we are forever accountable
                    for what we do or what we fail to do. We will never again compromise
                    our responsibilities. </p>
                    <p>Every saint and sinner in the history of our species lived there--on
                    a mote of dust suspended in a sunbeam.</p>
                </div>
                <div id="panel3">
                    <p>These words are the price of admission to the ranks of Mission
                    Control.</p>
                    <p>It&#39;s just mind-blowingly awesome. I apologize, and I wish I was
                    more articulate, but it&#39;s hard to be articulate when your mind&#39;s
                    blown—but in a very good way.</p>
                </div>
                <div id="panel4">
                    <p>From this day forward, Flight Control will be known by two words:
                    &#39;Tough&#39; and &#39;Competent.&#39; Tough means we are forever accountable
                    for what we do or what we fail to do. </p>
                    <p>Look again at that dot. That&#39;s here. That&#39;s home. That&#39;s us.
                    On it everyone you love, everyone you know, everyone you ever heard
                    of, every human being who ever was, lived out their lives. </p>
                </div>
                <div id="panel5">
                    <p>The view of the Earth from the Moon fascinated me—a small disk,
                    240,000 miles away. </p>
                    5
                    <p>The view of the Earth from the Moon fascinated me—a small disk,
                    240,000 miles away. </p>
                    5 </div>
            </div>
        </div>
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to create an if statement in PHP that prevents a single post
Basically, what I'm trying to create is a page of div tags, each has
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
I am trying to render a haml file in a javascript response like so:
I need a function that will clean a strings' special characters. I do NOT
I have some data like this: 1 2 3 4 5 9 2 6
I am trying to understand how to use SyndicationItem to display feed which is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.