Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Mouseover Help Please.


Message #1 by "Tom Nocer" <chevelleneeded@y...> on Sun, 19 Jan 2003 21:28:59
I saw a posting on a similar topic today 
:http://webdeveloper.earthweb.com/webjs/jsnavigation/item.php/107211

At 21:28 19/01/03 +0000, you wrote:
>I have a Left Nav Bar set up using a <table> that Im trying to get to work
>and am having a few problems with mouseover. Is there a way that I can
>have a cell of my Nav Bar highlighted when the person is on that page???
>Also is there anyway that I can get the Size of the Font to Zoom in larger
>on mouseover???  And my last question is there anyway that I can have just
>1 Cell, in my Nav Bar, not highlighted on mouseover???  Ive included the
>javascript Im using and an example of one of my links in the Nav Bar.
>
>Thanks for all the help.  Tom
>
>
>
>HERE IS THE MOUSEOVER JAVASCRIPT I AM USING:
>
><SCRIPT LANGUAGE=javascript>
>var MyEvent
>function EventOverNN(e)
>{
>  var MySrcElement = e?e.target:window.event.srcElement
>  if(MySrcElement.tagName == "TR")
>  {
>   MyEvent = MySrcElement
>  }
>  else if(MySrcElement.parentNode.tagName == "TR")
>  {
>   MyEvent = MySrcElement.parentNode
>  }
>  if(MyEvent)
>  {
>   MyEvent.style.backgroundColor = "black";
>   MyEvent.style.color = "#B22222";
>   MyAnchors = MyEvent.getElementsByTagName("A");
>   for(var i=0; i< MyAnchors.length; i++)
>   {
>    MyAnchors[i].style.color = "#B22222";
>   }
>  }
>}
>
>function EventOutNN(e)
>{
>  var MySrcElement = e?e.target:window.event.srcElement
>  if(MySrcElement.tagName == "TR")
>  {
>   MyEvent = MySrcElement
>  }
>  else if(MySrcElement.parentNode.tagName == "TR")
>  {
>   MyEvent = MySrcElement.parentNode
>  }
>  if(MyEvent)
>  {
>   MyEvent.style.backgroundColor = "";
>   MyEvent.style.color = "";
>   MyAnchors = MyEvent.getElementsByTagName("A");
>   for(var i=0; i< MyAnchors.length; i++)
>   {
>    MyAnchors[i].style.color = "";
>   }
>  }
>}
>
>function init()
>{
>  document.getElementById("MyTable").onmouseover = EventOverNN
>  document.getElementById("MyTable").onmouseout = EventOutNN
>}
></SCRIPT>
>
>
>
>AND HERE ARE MY CELLS ON THE WEBPAGE:
>
><tr><td class="leftnav" height="5%" align="left" valign="top"
>onClick="window.location.href='ataglance.htm?value=1';"
>style="cursor:hand; cursor:pointer"><b>At A Glance</b></td></tr>
>
>
>
>
>Thanks Everyone, Tom




  Return to Index