Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2006
    Location
    Boise, ID
    Posts
    334
    Plugin Contributions
    0

    Default simple DIV tag ?

    Hello all, Ajah :-)

    wondering if I might get a bit of help with a DIV tag, I simply want it to FADE open, not just suddenly open so it opens visually very nice,
    AND to get the DIV window to CLOSE when anything OUTSIDE the div window is clicked AND need to setup at leat 5 of these open windows
    and only want 1 to be open at any time.

    any help would be appriciated.

    <script language="JavaScript">
    function toggle(id) {
    var state = document.getElementById(id).style.display;
    if (state == 'none') {
    document.getElementById(id).style.display = 'block';
    } else {
    document.getElementById(id).style.display = 'none';
    }
    }
    </script>
    </head>
    <body>
    <h1>Toggle Div Visibility</h1>
    <div><a href="#" onclick="toggle('toggled'); return false;"><font color="#000000">Toggle</font></a></div>
    <div id="toggled" style="display:none; background-color: yellow; border: 1px solid black; width: 200px; height: 100px; position: absolute;top: 100px; left: 100px;">


    ALL HTML to show in DIV here!



    </div>
    <div>
    I'm just here to show the affect on document flow.
    </div>

  2. #2
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,262
    Plugin Contributions
    3

    Default Re: simple DIV tag ?

    Javascript needs to be properly "loaded" in your file/folder system in order to operate properly. It is not a good idea to try to embed javascript into the raw HTML - particularly on EZPages, because these do not load in the required chronology for a script to be run.

    See this tutorial:
    http://www.zen-cart.com/wiki/index.p...s_-_Javascript
    19 years a Zencart User

  3. #3
    Join Date
    Oct 2006
    Location
    Alberta, Canada
    Posts
    4,571
    Plugin Contributions
    1

    Default Re: simple DIV tag ?

    Further to that mentioned by schoolboy, I would suggest using jQuery to prevent a spaghetti code situation; which could happen quite easily if using regular JS.

    Although what you ask may seem simple on the face of it, there is more work to it then one may think.

 

 

Similar Threads

  1. v139h How to get div#NavEZpagesTop on same line as div#NavMain
    By idc1 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 12 Mar 2013, 06:16 PM
  2. where is the div tag for... Home :: All Products
    By hangman21 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 19 Jul 2010, 09:11 AM
  3. where is the div tag for all products stylesheet.css?
    By hangman21 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 19 Jul 2010, 07:39 AM
  4. Can't get logo div and horizontal menu div to touch
    By Chuckwa in forum Templates, Stylesheets, Page Layout
    Replies: 14
    Last Post: 28 May 2010, 07:16 PM
  5. How to let <div> tag auto flow?
    By rooisnor in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 7 Jan 2009, 11:19 PM

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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR