Need some quickie javascript help

Jonny_B

Erect Member
Oct 14, 2004
9,162
26
41
Marklar
₥76
My "expand all" and "collapse all" links aren't working in IE. Anyone help?



this is the function:
Code:
function toggleAll(newdisplay)
  {
    var x = document.getElementsByTagName("li");
    for (var i=0;i<x.length;i++)
    {
      var classname = x[i].getAttribute("class");
      if (!(classname=="detail")) continue;
    
      element = x[i].style;
      element.display=newdisplay;
    }
  }

these are the calls:
Code:
<a href="javascript:toggleAll('block')">expand all</a> : <a href="javascript:toggleAll('none')">collapse all</a>
 
Last edited:
fuck all do i hate javascript/html
yeah, but i'm an amateur hack so i use what i got. any ideas?

what's to hate anyway? works fine for simple stuff. that's all i'm doing.

edit: hid the calls. they're available at amenities2.php
 
Last edited:
I don't see an 'expand all'.

Additionally, it seems to randomly require clicking twice in IE to expand/collapse items. Fucking IE.

edit: See your edit
 
Bah, I just don't understand enough of this stuff. Needs moar web guys. wr3kt? elpmis? I gots nothing.

edit: uhhh, i don't see it in the main page yet.
 
Last edited: