SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Toggling Issue

  1. #1
    SitePoint Addict swaraj_here's Avatar
    Join Date
    Jan 2007
    Location
    India
    Posts
    224
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question 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.

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,190
    Mentioned
    191 Post(s)
    Tagged
    2 Thread(s)

    toggle value

    If this is to pass a style from page to page, using a cookie is probably your best bet.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •