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 8734065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:46:14+00:00 2026-06-13T09:46:14+00:00

Right now I have a basic template built to allow me to toggle sliding

  • 0

Right now I have a basic template built to allow me to toggle sliding 4 different divs into a frame

here is the site – try clicking the eyes, nose, or forehead

as you can see a div slides into the frame but,

now I want to add the functionality to slide the center div out when one of the div’s slide in (so if the top div slides in the div on the screen will slide down and if the left div slides in the screen will slide right, etc)

any way to make this happen? I think it would have a great effect with the transitioned background

thanks everyone

katie

  • 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-06-13T09:46:15+00:00Added an answer on June 13, 2026 at 9:46 am

    What you need to do is absolutely position your content div within a fixed center div. This will allow you to move around your content div, relative to the center of the page. I am using css-transitions to apply the slide effect. So the sliding will only work in modern browsers, but it degrades nicely to outdated IE browsers.

    Here’s the fiddle with a working demo: http://jsfiddle.net/WVPDH/263/

    You will obviously need to modify this code some to work with your page, but it shouldn’t be all too difficult to do so.

    I’ve posted the code below in case the fiddle link goes sour:

    HTML:

    <div id="fullContainer">
        <div id="right">
    
        </div>
        <div id="left">
    
        </div>
        <div id="top">
    
        </div>
        <div id="bottom">
    
        </div>
    </div>
    <div id="centerContainer">
        <div id="relativeContainer">
            <div id="content">
                This is where your face should go.  Notice that I placed it within a centering div.  
                This will enable the face to be absolutely positioned, and allow for you to modify 
                it's position when the side-bars slide in.
                <div data-move="left">Open Left</div>
                <div data-move="right">Open Right</div>
                <div data-move="top">Open Top</div>
                <div data-move="bottom">Open Bottom</div>
            </div>
        </div>
    </div>
    

    CSS:

    #centerContainer {
        position:fixed;
        top:50%;
        left:50%;
        width:0;
        height:0;
    }
    #relativeContainer {
        position:relative;
    }
    #fullContainer {
        position:fixed;
        width:100%;
        height:100%;
        top:0;
        left:0;
    }
    #content {
        position:absolute;
        width:300px;
        height:400px;
        top:-200px;
        left:-150px;
        background:#BADA55;
        border:1px solid #444;
        padding:10px;
        -webkit-transition: all 0.5s ease;
        -moz-transition: all 0.5s ease;
        -o-transition: all 0.5s ease;
        transition: all 0.5s ease;
    }
    #content.right {
        left:-250px;
    }
    #content.left {
        left:-50px;
    }
    #content.bottom {
        top:-300px;
    }
    #content.top {
        top:-100px;
    }
    
    #content div {
        cursor:pointer;
        color:blue;
        text-decoration:underline;
        margin-top:15px;
        text-align:center;
    }
    #left {
        position:absolute;
        top:0;
        left:-125px;
        height:100%;
        width:100px;
        background:blue;
        border:1px solid #444;
        padding:10px;
        -webkit-transition: all 0.5s ease;
        -moz-transition: all 0.5s ease;
        -o-transition: all 0.5s ease;
        transition: all 0.5s ease;
    }
    
    #left.opened {
        left:0;
    }
    
    #right {
        position:absolute;
        top:0;
        right:-125px;
        height:100%;
        width:100px;
        background:green;
        border:1px solid #444;
        padding:10px;
        -webkit-transition: all 0.5s ease;
        -moz-transition: all 0.5s ease;
        -o-transition: all 0.5s ease;
        transition: all 0.5s ease;
    }
    
    #right.opened {
        right:0;
    }
    
    #top {
        position:absolute;
        left:0;
        top:-125px;
        width:100%;
        height:100px;
        background:yellow;
        border:1px solid #444;
        padding:10px;
        -webkit-transition: all 0.5s ease;
        -moz-transition: all 0.5s ease;
        -o-transition: all 0.5s ease;
        transition: all 0.5s ease;
    }
    
    #top.opened {
        top:0;
    }
    
    #bottom {
        position:absolute;
        left:0;
        bottom:-125px;
        width:100%;
        height:100px;
        background:red;
        border:1px solid #444;
        padding:10px;
        -webkit-transition: all 0.5s ease;
        -moz-transition: all 0.5s ease;
        -o-transition: all 0.5s ease;
        transition: all 0.5s ease;
    }
    
    #bottom.opened {
        bottom:0;
    }
    

    JS:

    function SlideOut(element){
    
        $(".opened").removeClass("opened");
        $("#"+element).addClass("opened");
        $("#content").removeClass().addClass(element);
    
    }
    $("#content div").click(function(){
    
        var move = $(this).data('move');
    
        SlideOut(move);
    
    });
    ​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So right now I have a fairly basic Executor service that I use to
So I'm trying to learn C right now, and I have some basic struct
So I'm trying to learn C right now, and I have some basic struct
I have a very basic question about populating listviews in android. Right now, if
Good day! I right now have a function the drags an element from a
Right now I have an upload field while uploads files to the server. The
Right now I have a script that will get the last five files in
Right now I have 3 tables: User, Roles, and User_Roles for the many-to-many association.
Right now I have a function, in a class that is used to listen
Right now I have a link that causes a hidden div to appear when

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.