Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts

    need a quick hand modifying a script to allow the onmouseover of table rows

    Hey,

    I have been using a simple img.src changer script to have onmouseover displays (i.e: if you onmouseover an image button, the source of a static pic on the page gets changed so it displays the title of that button, as seen on the vertical black and white buttons here: www.enviromark.ca/head/indexInclude.php)

    I am trying to modify it so that i can onmouseover a table row to do the same thing

    so far i have
    Code:
    function onStaff1() 
    {if (!document.images) return; document.infoButton.src = "images/staff/info_BW.jpg"; document.staffPhoto.src = "images/staff/Marlo.jpg";} 
    function onStaff2() 
    {if (!document.images) return; document.YPPButton.src = "images/staff/YPP_BW.jpg"; document.staffPhoto.src = "images/staff/Leah.jpg";} 
    ...
    and
    
    function offStaff1() 
    {if (!document.images) return; document.infoButton.src = "images/staff/info_BW.jpg"; document.staffPhoto.src = "images/staff/blankPhoto.jpg";} 
    function offStaff2() 
    {if (!document.images) return; document.YPPButton.src = "images/staff/YPP_BW.jpg"; document.staffPhoto.src = "images/staff/blankPhoto.jpg";}
    Now the problem here is with the
    {if (!document.images) return; document.infoButton.src = "images/staff/info_BW.jpg"; because what i want to do is have the following:

    Code:
     <TR CLASS="MYTABLE" <TR CLASS="MYTABLE" onmouseover="onStaff1()" onmouseout="offStaff1()">  
    						<TD CLASS="MYTABLE">Marlo Turner-Ritchie</TD>
    						<TD CLASS="MYTABLE">Executive Director</TD>
    						<TD CLASS="EMAILCELLS"><script>displaycontact(contacts[0], "emails", "text", "")</script></TD>
    					  </TR>
    				   
    					  <TR CLASS="MYTABLE" onmouseover="onStaff2()" onmouseout="offStaff2()">  
    						<TD CLASS="MYTABLE">Leah Dolgoy</TD>
    						<TD CLASS="MYTABLE">Fundraising & Development</TD>
    						<TD CLASS="EMAILCELLS"><script>displaycontact(contacts[1], "emails", "text", "")</script></TD>
    					  </TR> 
    						<TD CLASS="MYTABLE">Marlo Turner-Ritchie</TD>
    						<TD CLASS="MYTABLE">Executive Director</TD>
    						<TD CLASS="EMAILCELLS"><script>displaycontact(contacts[0], "emails", "text", "")</script></TD>
    					  </TR>
    				   
    					  <TR CLASS="MYTABLE" onmouseover="onStaff2()" onmouseout="offStaff2()">  
    						<TD CLASS="MYTABLE">Leah Dolgoy</TD>
    						<TD CLASS="MYTABLE">Fundraising & Development</TD>
    						<TD CLASS="EMAILCELLS"><script>displaycontact(contacts[1], "emails", "text", "")</script></TD>
    					  </TR>
    What do i change the bolded line in the javascript to in order to allow me to do this? The script seems to be coded to only accept the onmouseover of images as a trigger for the source change
    Last edited by canadianjameson; 08-29-2007 at 09:40 PM.
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)

  • #2
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts
    actually hold on, I think I got it

    Yup, fixed it meeself

    Quick question though:

    why doesn't this work:
    Code:
    function onStaff1() 
    {document.staffPhoto.src = "images/staff/Marlo.jpg"; this.bgColor='gold'}
    this referring to the table row that I am onmouseover'ing...
    Last edited by canadianjameson; 08-29-2007 at 11:08 PM.
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •