Brigog Posted June 21, 2006 Share Posted June 21, 2006 I am new to html/javascript but what I currently have the following:<th width="200" height="25" scope="col"></a href><a href="#" onmouseover="MM_swapImage('Contact Us','','Images/Contact_Us_Button_Over.jpg',1)" onmouseout="MM_swapImgRestore()"><img src="Images/Contact_Us_Button.jpg" alt="Contact Us" name="Contact Us" width="200" height="25" border="0" id="Contact Us" /></a></th>Its a simple rollover from one image to another but instead of linking to another page I would like it to link to my e-mail. Ive tryed many things but no dice, please help if you can and thanks. Link to comment Share on other sites More sharing options...
scott100 Posted June 21, 2006 Share Posted June 21, 2006 (edited) Remove the anchor and add this onmouseover to your current one.<input type="button" value="Hover"onmouseover="self.location='mailto:jburns@htmlgoodies.com'">EDIT use self.location Edited June 21, 2006 by scott100 Link to comment Share on other sites More sharing options...
Brigog Posted June 21, 2006 Author Share Posted June 21, 2006 Remove the anchor and add this onmouseover to your current one.<input type="button" value="Hover"onmouseover="self.location='mailto:jburns@htmlgoodies.com'">EDIT use self.location<{POST_SNAPBACK}> Can you show me where in the script I posted it would go, I think I know what you mean but not positive. Link to comment Share on other sites More sharing options...
scott100 Posted June 21, 2006 Share Posted June 21, 2006 Can you show me where in the script I posted it would go, I think I know what you mean but not positive.<{POST_SNAPBACK}> Actually, don't remove the anchor, add this<th width="200" height="25" scope="col"><a href="java script:void(0)" onmouseover="MM_swapImage('Contact Us','','Images/Contact_Us_Button_Over.jpg',1);self.location='mailto:jburns@htmlgoodies.com'" onmouseout="MM_swapImgRestore()"><img src="Images/Contact_Us_Button.jpg" alt="Contact Us" name="Contact Us" width="200" height="25" border="0" id="Contact Us" /></a></th> Link to comment Share on other sites More sharing options...
Brigog Posted June 21, 2006 Author Share Posted June 21, 2006 Actually, don't remove the anchor, add this<th width="200" height="25" scope="col"><a href="java script:void(0)" onmouseover="MM_swapImage('Contact Us','','Images/Contact_Us_Button_Over.jpg',1);self.location='mailto:jburns@htmlgoodies.com'" onmouseout="MM_swapImgRestore()"><img src="Images/Contact_Us_Button.jpg" alt="Contact Us" name="Contact Us" width="200" height="25" border="0" id="Contact Us" /></a></th><{POST_SNAPBACK}> Okie that works but I wanna make it so it only opens e-mail when they click rather then mouse over. Sorry I should have said that before. Link to comment Share on other sites More sharing options...
Brigog Posted June 21, 2006 Author Share Posted June 21, 2006 nm, got it with this:<th width="200" height="25" scope="col"></a href><a href="#" onmouseover="MM_swapImage('Contact Us','','Images/Contact_Us_Button_Over.jpg',1)" onclick="self.location='mailto:jburns@htmlgoodies.com'" onmouseout="MM_swapImgRestore()"><img src="Images/Contact_Us_Button.jpg" alt="Contact Us" name="Contact Us" width="200" height="25" border="0" id="Contact Us" /></a></th> </table></td> Link to comment Share on other sites More sharing options...
justsomeguy Posted June 22, 2006 Share Posted June 22, 2006 Keep in mind that mailto won't work for some people, if you want it to work for everyone you will need to use a server-side language to send the mail, not javascript. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now