Home > Uncategorized > Can you guess what the code below is doing?

Can you guess what the code below is doing?

October 6th, 2006 rama Leave a comment Go to comments

If you can guess right, I will share with you my personal worthy notes on CSS and the 5 greatest aricles that have been hidden from much of the dev population

The list includes but is not limited to

  • Universal Selectors
  • CSS 2.1 compatibility
  • CSS formatting techniques

$p=$('leftNavContainer');
$l1=$A(getElementsByClassName($p, "li", "level1")) $l2=getElementsByClassName($p, "li", "level2");
$l3=getElementsByClassName($p, "li", "level3");
var l1tog;
//Level 1 moo=$l1.each ( function doclick(theli)
{
Event.observe(theli,'click', function(item)
{
//alert(Event.element(event).parentElement.childNodes[0].outerHTML);
//$ul=$A(Event.element(event).parentElement.getElementsByTagName("UL"));
$ul=Event.element(event).parentElement.getElementsByTagName("UL")[0];
if($ul) $cul=$A($ul.getElementsByTagName("UL"));
Event.element(event).className="lhnLinkSelected";
$sl=$A(getElementsByClassName($p, "a", "lhnLinkSelected")) //alert($sl.length);
$sl.each( function resetBold(ther)
{
if(ther!=Event.element(event))
{
ther.className="lhnLink";
if($ul)
{
//alert($ul.parentElement.parentElement.parentElement.innerText);
$ul.parentElement.parentElement.parentElement.childNodes[0].className="lhnLinkSelected";
}
//ther.className.replace("lhnLinkSelected","")
}
}
) //alert($cul.length);
if($ul)
{
$cul.each ( function hidelem(theitem)
{
//alert(Event.element(event).parentElement.innertext);
//alert(theitem.childNodes[0].childNodes[0].tagName);
Element.hide(theitem);
}
) Element.toggle($ul);
}
else
{
alert("no action")
}
//alert(event.srcElement.parentElement.getElementsByTagName("UL").length);
}
) //theli.onclick=function exclick()
{
}
}
) /* //Level 2 $l2.each ( function doclick2(theli2)
{
Event.observe (theli2,'click', function exclick2()
{
}
)
}
) */

Categories: Uncategorized Tags:
  1. niharika
    January 16th, 2007 at 16:31 | #1

    this code is working properly in IE but not in Firefox.Some javascript error like event not declared
    in line $ul=Event.element(event).parentElement.getElementsByTagName(“UL”)[0];
    Please help its urgent

  1. No trackbacks yet.