PHP-test 11


Text of the file "hov-act.htc"

<attach event="onmouseover" handler="hoverRollOver" />
<attach event="onmouseout" handler="hoverRollOff" />

<attach event="onclick" handler="clickActive" />

<script type="text/javascript">
//
//  Simple behaviour for IE5+ to emulate :hover CSS pseudo-class.
//  Experimental ver 0.1
//
//  This is an experimental version! Handle with care!
//  Manual at: http://www.hszk.bme.hu/~hj130/css/list_menu/hover/
//
//  Modified by Bo Johansson 2004-01-16 to also emulate the
//  :active CSS pseudo-class, using the onclick event handler
//

function hoverRollOver()
{
  element.origClassName = element.className;  // backup origonal className
  var tempClassStr = element.className;
  tempClassStr += "Hover";          // convert name+'Hover' the last class name  to emulate tag.class:hover
  tempClassStr = tempClassStr.replace(/\s/g,"Hover ");  //convert name+'Hover' the others to emulate tag.class:hover
  tempClassStr += " hover";        // add simple 'hover' class name to emulate tag:hover
  element.className = element.className + " " + tempClassStr;
  //window.status = element.className;    // only for TEST
}
function hoverRollOff() {
  element.className = element.origClassName;
}

function clickActive()
{
  element.origClassName = element.className;  // backup origonal className
  var tempClassStr = element.className;
  tempClassStr += "Active";          // convert name+'Active' the last class name  to emulate tag.class:active
  tempClassStr = tempClassStr.replace(/\s/g,"Active ");  //convert name+'Active' the others to emulate tag.class:active
  tempClassStr += " active";        // add simple 'active' class name to emulate tag:active
  element.className = element.className + " " + tempClassStr;
  //window.status = element.className;    // only for TEST
}

</script>


Page created 2003-03-22, last changed 2004-01-16 19:28

© 2004 Bo Johansson