Hey there, I have two divs - one named basic and the other advanced. There's a button to show the advanced div. Currently, when I click on the button, it toggles down. However, I would like it to slide from right to left instead.
Here's the HTML code:
<div class="container" id="divBasic">Basic data</div>
<div class="container top_offset" id="divAdvanced" style=""> Advanced data</div>
<a style="float:right; margin-right: 10px; padding-right: 10px" href="javascript:void(0);" onclick="toggle_advanced(this);" id="hpAdvanced_top">Show Advanced ></a>
And here's the JavaScript code:
function toggle_basic(source) {
var div = $("#divBasic");
var top_btn = $("#divButtons");
div.toggle();
top_btn.toggle();
$("#divShapes").toggle();
if (source == "shapes") {
storeValue("Basic", "none");
} else {
storeValue("Basic", "block");
}
}
function toggle_advanced(hp) {
var divAdvanced = $("#divAdvanced");
divAdvanced.toggle();
if (hp.outerText != "Show Advanced") {
storeValue("Advanced", "none");
hp.innerText = "Show Advanced";
} else {
storeValue("Advanced", "block");
hp.innerText = "Hide Advanced";
}
}
If anyone can help me achieve the sliding effect for the advanced div, I would greatly appreciate it.
Thank you!