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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:55:52+00:00 2026-05-26T17:55:52+00:00

I have the following HTML.. I’d like to hide the SIDEBAR div on load

  • 0

I have the following HTML.. I’d like to hide the SIDEBAR div on load and toggle it with the HREF separator or an image.. What is the most simple way to achieve this? Currently the page will show the sidebar div and i can toggle it with the link.. however I would like to change the link(or image) to (open/close) depending on state..

Found lots of ways to achieve this using slideup and slidedown.. just nothing from the side –

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style>
.left {float: left;}
.right {float: right;}
.hidden {display: none;}

#sidebar {
    display: none;
}
#content {
    background-color: #EFE;
    border-color: #CDC;
    width: 97%;
}

.use-sidebar #sidebar {
    display: block;
    width: 20%;
}

.sidebar-at-left #sidebar {margin-right: 1%;}
.sidebar-at-left #content, .use-sidebar.sidebar-at-right #sidebar, .sidebar-at-right #separator {float: right;}

#separator {
    display: block;
    outline: none;
    width: 10%;
}

</style>
</head>

<body>
<div class="use-sidebar sidebar-at-right" id="main">
    <div id="sidebar">Some HTML Poll Content Here</script></div>
    <a href="" id="separator">SHOW POLL</a>
    <div class="clearer">&nbsp;</div>
</div>


<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
    // Variables
    var objMain = $('#main');
    // Show sidebar
    function showSidebar(){
        objMain.addClass('use-sidebar');
        objMain.addClass('sidebar-on');
    }
    // Hide sidebar
    function hideSidebar(){
    objMain.removeClass('use-sidebar');
    objMain.addClass('sidebar-off');
    }

    // Sidebar separator
    var objSeparator = $('#separator');
    objSeparator.click(function(e){
        e.preventDefault();
        if ( objMain.hasClass('use-sidebar') ){
            hideSidebar();
        }
        else {
            showSidebar();
        }
    }).css('height', objSeparator.parent().outerHeight() + 'px');
});
</script>
</body>
</html>
  • 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-26T17:55:53+00:00Added an answer on May 26, 2026 at 5:55 pm

    The .slide() effects are just short hand notations for .animate().

    You can just create your own: http://jsfiddle.net/rkw79/2dgg8/2/

    Set the ‘left’ property outside of view range and then put it into view on click.

    $('input').toggle(function() {
        $('div').animate({
            left: '0px'
        });
        $(this).val('close');
    }, function() {
        $('div').animate({
            left: '-150px'
        });
        $(this).val('open');
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following HTML: <div id=mydiv> </div> I would like to load content
i have following HTML structure: <div class=container> <div class=sidebar></div> <div class=content></div> <div class=subscript></div> </div>
I have following HTML markup, <div id=subcontent_l> <p> <a href=/membership-packages/><img height=202 width=644 alt= src=http://74.52.72.231/wp-content/uploads/2010/06/banner1.jpg
I have following HTML <div id=finalTree> <ul> <li class=last style=display: list-item;> <a id=DataSheets href=#>Data
I have following HTML <div id=header1 class=toggle>Section 1 : Create an account</div> <div id=section1>
i have the following html , and i want to hide all lsHeader which
I have the following html code. <html> <body> <div style=max-width:1600px; min-width:900px; > <table> </table>
I have following html: <html ><body >Body text <div >div content</div></body></html> How could I
I have following html: <div class=rows> <div class=row><input type=text onchange=javascript:getIndex(this); value= /></div> <div class=row><input
I have the following HTML: <tr> <td class=ui-widget-content> <a title=Edit href=/Administration/Menus/Edit/001W class=editLink ui-button ui-widget

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.