Team:GeorgiaState/Test

From 2012.igem.org

(Difference between revisions)
Line 1: Line 1:
-
/* Credits: Stu Nicholls */
+
<div id='cssmenu'>
-
/* URL: http://www.stunicholls.com/menu/pro_drop_1/stuHover.js */
+
<ul>
-
 
+
  <li class='active '><a href='index.html'><span>Home</span></a></li>
-
stuHover = function() {
+
  <li class='has-sub '><a href='#'><span>Our Team</span></a>
-
var cssRule;
+
      <ul>
-
var newSelector;
+
        <li class='has-sub '><a href='#'><span>Product 1</span></a>
-
for (var i = 0; i < document.styleSheets.length; i++)
+
            <ul>
-
for (var x = 0; x < document.styleSheets[i].rules.length ; x++)
+
              <li><a href='#'><span>Sub Item</span></a></li>
-
{
+
              <li><a href='#'><span>Sub Item</span></a></li>
-
cssRule = document.styleSheets[i].rules[x];
+
            </ul>
-
if (cssRule.selectorText.indexOf("LI:hover") >= 0)
+
        </li>
-
{
+
        <li class='has-sub '><a href='#'><span>Product 2</span></a>
-
newSelector = cssRule.selectorText.replace(/LI:hover/gi, "LI.iehover");
+
            <ul>
-
document.styleSheets[i].addRule(newSelector , cssRule.style.cssText);
+
              <li><a href='#'><span>Sub Item</span></a></li>
-
}
+
              <li><a href='#'><span>Sub Item</span></a></li>
-
}
+
            </ul>
-
var getElm = document.getElementById("nav").getElementsByTagName("LI");
+
        </li>
-
for (var i=0; i<getElm.length; i++) {
+
      </ul>
-
getElm[i].onmouseover=function() {
+
  </li>
-
this.className+=" iehover";
+
  <li><a href='#'><span>About</span></a></li>
-
}
+
  <li><a href='#'><span>Contact</span></a></li>
-
getElm[i].onmouseout=function() {
+
</ul>
-
this.className=this.className.replace(new RegExp(" iehover\\b"), "");
+
</div>
-
}
+
-
}
+
-
}
+
-
if (window.attachEvent) window.attachEvent("onload", stuHover);
+

Revision as of 14:43, 13 September 2012

  • <a href='index.html'>Home</a>
  • <a href='#'>Our Team</a>
    • <a href='#'>Product 1</a>
      • <a href='#'>Sub Item</a>
      • <a href='#'>Sub Item</a>
    • <a href='#'>Product 2</a>
      • <a href='#'>Sub Item</a>
      • <a href='#'>Sub Item</a>
  • <a href='#'>About</a>
  • <a href='#'>Contact</a>