SitePoint Sponsor |
|
User Tag List
Results 1 to 2 of 2
Thread: Toggling Issue
-
Jun 12, 2007, 01:30 #1
Toggling Issue
Hi.......
I am using this script to toggle a div...what I want is when I once toggled off the div......it should be in same status all across the pages....irrespective of the page inside which I had the toggled off.
I have thought out to store the variable value somewhere in the same location, so that any page will get opened it will first check the value returned during last toggle.
The script is as follow
<script type="text/javascript">
// collapse column
function expand(swapimg) {
if(document.getElementById)
var hide = document.getElementById("left");
var bodyEl = document.getElementsByTagName('body')[0];
{
if (hide.style.display == "none") {
bodyEl.className=bodyEl.className.replace(new RegExp("widex\\b"), "wide");
hide.style.display="block";
swapimg.src = "images/imgToggleBtn.gif";
swapimg.setAttribute("alt","Toggle Left Navigation");
swapimg.setAttribute("title","Toggle Left Navigation");
}
else
{
bodyEl.className=bodyEl.className.replace(new RegExp("wide\\b"), "widex");
hide.style.display="none";
swapimg.src = "images/imgToggleBtnToggled.gif";
swapimg.setAttribute("alt","Toggle Left Navigation");
swapimg.setAttribute("title","Toggle Left Navigation");
}
}
}
</script>
But as I don't have idea to create java script or dynamic page so please assist me! Thanks to all of you.
-
Jun 12, 2007, 06:37 #2
- Join Date
- Jul 2005
- Location
- West Springfield, Massachusetts
- Posts
- 17,290
- Mentioned
- 198 Post(s)
- Tagged
- 3 Thread(s)
toggle value
If this is to pass a style from page to page, using a cookie is probably your best bet.
Big Change Coming Soon - if you want your PMs save them now!
What you need to do to prepare for our migration to Discourse
A New SitePoint Forum Experience: Our Move to Discourse
Bookmarks