RockyŠ Posted September 7, 2010 Share Posted September 7, 2010 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 More sharing options...
thescientist Posted September 7, 2010 Share Posted September 7, 2010 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 More sharing options...
RockyŠ Posted September 7, 2010 Author Share Posted September 7, 2010 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. Link to comment Share on other sites More sharing options...
ShadowMage Posted September 7, 2010 Share Posted September 7, 2010 I think CSS display and visibility is what you're looking for. Link to comment Share on other sites More sharing options...
jeffman Posted September 7, 2010 Share Posted September 7, 2010 That tutorial works best if you View Source and look at the JavaScript and look at the code that makes the flower panel work. Link to comment Share on other sites More sharing options...
dsonesuk Posted September 7, 2010 Share Posted September 7, 2010 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 More sharing options...
RockyŠ Posted September 7, 2010 Author Share Posted September 7, 2010 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 More sharing options...
thescientist Posted September 8, 2010 Share Posted September 8, 2010 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.