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

  • SEARCH
  • Home
  • 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 5997791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:18:51+00:00 2026-05-23T00:18:51+00:00

I am trying to create a slide transition effect like the one posted in

  • 0

I am trying to create a slide transition effect like the one posted in the video http://www.youtube.com/watch?v=SZTiJmclaRc.

When the button is clicked the current div#1 will be sliding out to the left and hide itself while another div#2 will be sliding from the right and move to the location of of the previous slided out div.

And when the button is trigger again the div#2 will be sliding out to right while the previously hide div#1 will be sliding out from left.

I have been trying to modify the code at http://jsfiddle.net/qSvDz/ as below but I can’t seem to get the result I wanted.

Could anyone pls share me some thought on how to do it.

function toggleDivs() {
var $home = $("#home");
var $memberHome = $("#member-home");
var $slideOut, $slideIn;

// See which <divs> should be animated in/out.
if ($home.position().left < 0) {
    $slideIn = $home;
    $slideOut = $memberHome;
}
else {
    $slideIn = $memberHome;
    $slideOut = $home;
}

$slideOut.animate({
    left: "-" + $slideOut.width() + "px"
}, function() {
    $slideIn.animate({ left: "0px" });
});
}

$("button").bind("click", function() { 
    toggleDivs();
});

Thanks
Fire

  • 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-23T00:18:52+00:00Added an answer on May 23, 2026 at 12:18 am

    Something like this?

    http://jsfiddle.net/k_rma/VmSX4/

    HTML:

    <div id="container">
        <div id="inner">
            <div id="home">
                <button>Click</button>
            </div>
            <div id="member-home">
                <button>Click</button>
            </div>
        </div> 
    </div>
    

    JS/JQUERY:

    function toggleDivs() {
        var $inner = $("#inner");
    
        // See which <divs> should be animated in/out.
        if ($inner.position().left == 0) {
            $inner.animate({
                left: "-400px"
            });
        }
        else {
            $inner.animate({
                left: "0px"
            });
        }
    }
    
    $("button").bind("click", function() {
        toggleDivs();
    });
    

    CSS:

    #container {
        position:relative;
        border: 1px solid black;
        width:400px;
        height:600px;
        overflow:hidden
    }
    #inner {
        position: relative;
        width: 800px; 
    }
    #home {
        position:absolute;
        width: 400px;
        height: 600px;
        background-color: red;
    }
    
    #member-home {
        position:absolute;
        left:400px;
        width: 400px;
        height: 600px;
        background-color: green;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a transition/animation on a UIView that looks something like the
I've been trying to create a slide show, here is my attempt: http://jsfiddle.net/paulmason411/fNfKk/ It's
I'm trying to create a simple wipe / slide type transition between 2 states.
I am trying to create a slider like this example. pls anyone help me.
I was trying to create an extension that could slice any array-like class (since
I'm trying to create a slideshow style presentation, where each slide/page is a movieclip
We're trying to create a PowerPoint slide programmaticaly. We can obtain bullets on a
I'm trying to create a footer that will slide from the bottom of the
I'm trying to create a jQuery widget which extends from ui.slider . I'd like
I'm trying to create a mouse-over effect that slides the top layer to the

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.