Toggle Two Divs Percentage Width With One Button
i want to toggle the width of two divs with one button as seen on: http://www.ulrichshusen.de The menu on top shrinks while the left area is shown. And it expands while the left a
Solution 1:
$(document).ready(function(){
$('**button class here**').click(function(){
$('div to be resized').toggle();
$('div to be resized').toggle();
)};
});
Here is to add class and remove class
$(document).ready(function(){
$('**button class here**').click(function(){
$(this).sibling().removeClass().addClass();
)};
});
This should help you get started in the right direction. You will probably need some if statements added and or current states of each, but Christian Varga is correct it would be simple to do .addClass then add the class of what the div state should be. Hope this gets you started.
Post a Comment for "Toggle Two Divs Percentage Width With One Button"