User Profile

Collapse

Profile Sidebar

Collapse
dusk
dusk
Last Activity: Mar 3 '08, 08:27 PM
Joined: Jan 22 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • 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...
    See more | Go to post

    Leave a comment:


  • dusk
    started a topic hide some divs, show some others (but not all)

    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...
    See more | Go to post

  • dusk
    replied to hide all divs without array?
    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...
    See more | Go to post

    Leave a comment:


  • dusk
    replied to Nested Div's
    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?
    See more | Go to post
    Last edited by dusk; Jan 24 '08, 12:09 AM. Reason: misunderstood the question

    Leave a comment:


  • dusk
    replied to hide all divs without array?
    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){...
    See more | Go to post

    Leave a comment:


  • dusk
    replied to hide all divs without array?
    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...
    See more | Go to post
    Last edited by gits; Jan 22 '08, 10:12 PM. Reason: added code tags

    Leave a comment:


  • dusk
    started a topic hide all divs without array?

    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....
    See more | Go to post
    Last edited by gits; Jan 22 '08, 10:10 AM. Reason: added code tags
No activity results to display
Show More
Working...