Jump to content

Problem with DIV Toggle


RockyŠ

Recommended Posts

When I open index.html toggle is always visible, I want that is hidden and when user clicks on link that div toggles, what am I doing wrong? (look where "PONUDBA" is written)Here's link (index.html)http://www.z-com.si/rok/Etna/and CSShttp://www.z-com.si/rok/Etna/default.css One more thing, I would like to add randome image on first page, do you have any suggestions where to put it?Fixed links

Link to comment
Share on other sites

that link is broken.if you are trying to change CSS styles definitions dynamically, then you need to use Javascript. I assume you aren't because you are posting in the HTML forum, and I assume that you do because you are requesting the action to be done onClick.

Link to comment
Share on other sites

your toggle works fine, You just have to hide the divs content on loading of page.window.onload=function(){parent_container = document.getElementById("sidebar");child_divs = parent_container.getElementsByTagName("div");for(i=0;i<child_divs.length;i++){child_divs.style.display="none";}}

Link to comment
Share on other sites

That tutorial works best if you View Source and look at the JavaScript and look at the code that makes the flower panel work.
I think that looking at source code is the best way of reading trough tutorials.
your toggle works fine, You just have to hide the divs content on loading of page.window.onload=function(){parent_container = document.getElementById("sidebar");child_divs = parent_container.getElementsByTagName("div");for(i=0;i<child_divs.length;i++){child_divs.style.display="none";}}
Thank you very much!
Link to comment
Share on other sites

Yes I'm using JS but problem is not in JS but in xhtml code I wrote... Not sure what it's and this is why I asked here.
I was just guessing because you're link was broken for me at the time. I had little way of knowing. Posting code is always a good backup to providing links if possible.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...