ok I've tried this but I can't get it to work... it gives me an 'error on page' message when I try using this
[html]
<A href="javascrip t:hidediv('a', 1)">click here</A> to hide
[/html]
and if I give it the exact name of a div, it hides that div correctly but not the others:
[html]
<A href="javascrip t:hidediv('a100 ', 1)">click...
User Profile
Collapse
-
hide some divs, show some others (but not all)
Hi,
I have a page with lots of hidden divs which are revealed based on choices made at each 'layer'.
So I've used naming convention which represents the order in which each div becomes visible - 'a100', 'a200', 'a300' for the first 'layer'; 'b100', 'b200', 'b300' for the second; 'c100, 'c200', 'c300' for the third ... etc
I'm writing the javascript functions to hide and show the appropriate divs and... -
Thanks for the help, I couldn't find a way to get the var divs = document.getEle mentsByTagName( 'div') line working, but I found another function which works fine, and it uses that line:
[html]
<script>
function clearAllDivs(pa ss) {
var divs = document.getEle mentsByTagName( 'div');
for(i=0;i<divs. length;i++){
if(divs[i].id.match(pass) ){//if they are 'see' divs
if...Leave a comment:
-
removed my post cause I misunderstood the question...
if its columns not rows you want, couldn't you just put the divs into a table?Leave a comment:
-
ok I've had a got with this but still can't get it working. I've tried putting:
var divs=document.g etElementsByTag Name('div')
at the start too but no luck.
Here's the simplified code that 'looks' like it should work to me, but doesn't...
[html]
<script language="JavaS cript">
var ids=document.ge tElementsByTagN ame('div')
function switchid(id){...Leave a comment:
-
Thanks gits, that seems like its exactly what I'm looking for. But I can't get it to work in my code...
You can see below there's a button which I made earlier to hide each div separately, and a new button which I tried to make hide all divs with the hideallids function, but its not working.
If anyone has any ideas they'd be much appreciated!
(incidentally, I don't think I'll need to use the secondary...Leave a comment:
-
hide all divs without array?
Hi,
I'm very new to javascript, and I'm having trouble finding a way to display a string of divs without the code getting really messy.
I have several different pages to write, each with about 15-20 divs, and I need users to be able to select a sequence of divs - basically like a series of yes/no questions that, when "yes" or "no" is selected, displays the appropriate div as well as what's come before it....
No activity results to display
Show More
Leave a comment: