Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Sidebars & Widgets »

show/hide left sidebar with javascript


  #1  
Old Jun 7, 2011, 05:34 AM
neckit
 
6 posts · May 2011
Hi,

on the "left sidebar" of my pages, i have a vertical menu.
Over the vertical Menu I have a simple Text-Box-Widget with an image-button to show/hide the menu.
Therefore i want to change the weight of the "left sidebar" and show/hide the widgets in the left sidebar.
Until now i have the following js-code, to show/hide the widgets.
But how can i set the width of the left sidbar with javascript.
I find no id for the left sidebar - only the class 'colone'.
Because I'm not very familar with css - can somebode help me?
I don't want to change the theme to place an id that I can use!

Code:
<script language="JavaScript" type="text/javascript">
function NavigationShowHide(parName){  
    if(document.getElementById(parName).title == "Hide Menu") {
	document.getElementById(parName).title = "Show Menu";
	document.getElementById(parName).src = "images/showMenu.png";
        top.document.getElementById('widget-1').style.visibility = 'hidden'; 
        top.document.getElementById('widget-2').style.visibility = 'hidden';
        // >>> How to change the weight of Left Sidebar?        
	// top.document.getElementById('colone').style.width = '60px';
	}	
    else {
	document.getElementById(parName).title = "Hide Menu";
	document.getElementById(parName).src = "images/hideMenu.png";
        top.document.getElementById('widget-1').style.visibility = 'visible';  
        top.document.getElementById('widget-2').style.visibility = 'visible';  
	// >>> How to change the weight of Left Sidebar?
        // top.document.getElementById('colone').style.width = '200px';
    }
}
</script>
greetings
Ralf
  #2  
Old Jun 7, 2011, 06:07 AM
lmilesw's Avatar
lmilesw
 
10,176 posts · Jul 2009
Central New York State USA
Do you have a link to your site?
Why are you using js code instead of a plugin and/or the theme options to accomplish this?
What version of Atahualpa are you on?
If at 3.6.7 have you applied all the bug fixes?
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.
  #3  
Old Jun 7, 2011, 08:45 AM
neckit
 
6 posts · May 2011
I'm using 3.6.7 with all bugfixes applied.
Because it is an intranet-solution i can't give you a link to it.

I know, that I can change the weight of the sidebar with the options of atahualpa. But it's only the fixed weight.
The user should be able to hide/show the menu dynamically (not dependent on one page). I do not think there is a plugin for this - so I must use javascript.

The reason for this is, that we also use WordPress as a control center to include various dashboards (with Pentaho http://www.pentaho.com/products/dashboards/). It works just fine - but sometimes the dashboards need more place. So I want, that the user can temporarily hide the menu.

Any idea for a javascript-solution?
  #4  
Old Jun 7, 2011, 10:06 PM
lmilesw's Avatar
lmilesw
 
10,176 posts · Jul 2009
Central New York State USA
The id for the left sidebar is td#left but it is in a table cell so I am not sure how you will accomplish what you want.
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.

Bookmarks



Similar Threads
Thread Thread Starter Forum Replies Last Post
Category menu moves to the left when javascript is activated Harald Page & Category Menu Bars 1 Nov 4, 2010 04:31 AM
[SOLVED] Hide left sidebar on just one custom php page that isn't in the options list marced Sidebars & Widgets 13 Mar 2, 2010 01:35 PM
Show Left Sidebar ONLY on _ONE_ page (without keeping a blank space for others) sleizure Sidebars & Widgets 2 Jun 10, 2009 12:38 PM
Left Sidebar css and javascript. Right sidebar tabs. Not visible or configurable. jinglebells New Versions, & Updating 2 Jun 6, 2009 09:22 PM


All times are GMT -6. The time now is 06:32 AM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.