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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:54:51+00:00 2026-06-15T02:54:51+00:00

I am trying to slide a DIV from right to left over another DIV.

  • 0

I am trying to slide a DIV from right to left over another DIV. It works for the initial slide over, but it’s the slide back that isn’t working. It slides back right to left again to disappear, then I try to click the button again but it won’t work after first open and close.

My code to follow:

function changeFeat () {
    if(jQuery('#featartinside').css('display') == 'none') {
        jQuery('#featartinside').animate({
            width: 730,
            marginLeft: 1,
            marginRight: -730,
            display: 'toggle'
        }, 'slow');
    } else {
        jQuery('#featartinside').animate({
            width: -730,
            marginLeft: 1,
            marginRight: 730,
            display: 'toggle'
        }, 'slow');
    }
}

#featartban {
    position: relative;
    background: url(../images/featart.png) top left no-repeat;
    width: 54px;
    height: 279px;
    cursor: pointer;
    float: left;
    left: 730px;
    margin-bottom: -279px;
}

#featartinside {
    height: 279px;
    width: 0;
    margin-left: 730px;
    background: #D13630;
    float: left;
    margin-bottom: -279px;
}

Like I said it works fine for opening, it’s the closing that isn’t working since it continues right to left instead of closing left to right. Then I can’t get a second open and close.

EDIT HTML:

<div id="featartban" onclick="changeFeat(); return false;"></div>
<div id="featartinside" style="display: none;"></div>
  • 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-15T02:54:53+00:00Added an answer on June 15, 2026 at 2:54 am

    Sticking to jQuery.

    <div id="featartban"></div>
    <div id="featartinside" style="display: none;"></div>​
    

    var $featartban = $("#featartban");
    var $featartinside = $("#featartinside");
    $featartban.toggle(function show() {
      $featartinside.animate({
        width: 730,
        marginLeft: 1,
        marginRight: -730,
        display: 'toggle'
      }, 'slow');
    }, function hide() {
      $featartinside.animate({
        width: 0,
        marginLeft: 730,
        marginRight: 0,
        display: 'toggle'
      }, 'slow');
    });​
    

    .toggle() (not confuse with .toggle()) is awesome.

    See it live here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use the function below to get a DIV to slide-out from
I'm trying to have a UIPickerView slide from the bottom of the screen (over
So I am trying to transfer over a div from one connected sortable container
I am trying to scroll text (list elements actually) from right to left. Here
I am trying to make ticker to scroll right to left from zero pixel
I am trying to make a div slide to a FIXED position on the
Eventually I'm trying to create a timed slide show that fades images in and
I'm trying to add DatePicker VBA control in an PowerPoint 2007 slide. But I
I am trying to create a JQuery plug in to slide some images from
I'm trying to have three columns. The left and right columns contain a button

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.