You are here:   Home
Register   |  Login

Captured Technology - Blog

Minimize

JavaScript OnMouseOver for Firefox

Apr 10

Written by:
4/10/2009 1:26 PM  RssIcon

JavaScript OnMouseOver for Firefox

I wrote a fairly simple JavaScript line to modify the size of an image when there is a OnMouseOver  event. And then wrote a similar line of JavaScript to reduce the size back to normal on the OnMouseOut event. The only problem is the JavaScript didn't work on FireFox although it was great with Internet Explorer. After some research I found that using the 'this' object was needed with FireFox. So I adjusted my code to also have the events in the image object itself. Here is the code:

 

<div align="center">
<table border="0" cellpadding="0" cellspacing="0" height="700px" width="215px">
    <tr height="140px" width="195px" align="center">
    <td><a href="AboutUs.aspx" 
        onmouseover="document.getElementById('AboutUs').style.width='205px'; document.getElementById('AboutUs').style.height='112px'" 
        onmouseout="document.getElementById('AboutUs').style.width='195px'; document.getElementById('AboutUs').style.height='105px'">
        <img border="0" alt="About Us" src="/Images/Home/AboutUs.gif" style="height: 105px; width:195px; position: static;" id="AboutUs" 
        onmouseover="this.style.width='205px'; this.style.height='112px'" 
        onmouseout="this.style.width='195px'; this.style.height='105px'" />    
    </a></td></tr>
</table>
</div>

Tags:
Categories:

17 comment(s) so far...


Gravatar

Re: JavaScript OnMouseOver for Firefox

Amazing blog! Why can't you write for our blog :(.

By Webmaster Forum on   4/15/2009 6:40 AM
Gravatar

Re: JavaScript OnMouseOver for Firefox

Interesting idea and well implement but would it not be better to swap images instead, replacing the smaller one with a bigger one?

That way you'd not get any image quality issues with resizing.

By pregnancy on   4/15/2009 7:25 AM
Gravatar

Re: JavaScript OnMouseOver for Firefox

So does this work on Firefox and IE?

If so it could be a neat solution.

By Telephone Answering Service on   4/15/2009 9:05 AM
Gravatar

Re: JavaScript OnMouseOver for Firefox

From my understanding it should work on both browsers

By World of Warcraft Miniatures on   4/15/2009 11:07 AM
Gravatar

Re: JavaScript OnMouseOver for Firefox

Thanks for the code. I've been having the same problem with firefox. Great work.

By seo service on   4/18/2009 11:27 PM
Gravatar

Re: JavaScript OnMouseOver for Firefox

I am just looking for this, good post and thanks for the code.

By Mckinney web design on   4/20/2009 3:56 AM
Gravatar

Re: JavaScript OnMouseOver for Firefox

Wow, Nice job. Maybe you can share a sample of your code or application of the javascript you made.

By Blazintech on   4/21/2009 10:28 AM
Gravatar

Re: JavaScript OnMouseOver for Firefox

Thanks, this was a real life saver for my mario flash games site :)

By free mario games on   4/23/2009 5:07 PM
Gravatar

Re: JavaScript OnMouseOver for Firefox

Thanks for providing the code.

By Website Design on   4/28/2009 4:32 AM
Gravatar

Re: JavaScript OnMouseOver for Firefox

Thanks for sharing the codes. I've been having the same problem when I'm using both Firefox and Internet explorer. I hope this time that both will work.

By Haptics on   4/30/2009 1:12 PM
Gravatar

Re: JavaScript OnMouseOver for Firefox

Good modification done.Hope it's working well now.

By Content Writing Services on   5/4/2009 5:55 AM
Gravatar

Re: JavaScript OnMouseOver for Firefox

Awesome, I was trying to figure out how to do that and this worked like a charm!

By mario games on   7/8/2009 10:29 PM
Gravatar

Re: JavaScript OnMouseOver for Firefox

thanks for the coder , i have saved the code for my work use :)

By rbts on   9/25/2009 1:23 AM
Gravatar

Re: JavaScript OnMouseOver for Firefox

it's very nice, thanks for the code

By embroidery machine on   10/21/2009 1:29 AM
Gravatar

Re: JavaScript OnMouseOver for Firefox

Thanks for your code.

By Roma Graff on   10/30/2009 1:20 AM
Gravatar

Re: JavaScript OnMouseOver for Firefox

Thanks for sharing the code

By Brooke Andarson on   10/30/2009 1:22 AM
Gravatar

Re: JavaScript OnMouseOver for Firefox

Great thanks for such a useful information as that one!
Grateful a lot!

By Mark Palermo on   11/29/2009 6:52 PM

Your name:
Gravatar Preview
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Security Code
CAPTCHA image
Enter the code shown above in the box below
Add Comment   Cancel 

FaceBook

Minimize

Mobile Version

Minimize
Add CapturedTech - Technology Mippin widget

Translate

Minimize

Sponsors

Minimize

Recent Comments

Minimize
Re: Three Benefits to Using a Royalty-Free Image on Your Website or Blog
Don't pay for royalty free images. They are free after all! I offer links to 96 websites that have tens of thousands (maybe even hundreds of thousands) of absolutely free images, including ones for commercial use! All you need to do is subscribe to my blog at www.davesinternetmarketing.info/royalty-free-images-free-for-commercial-use/
Re: Buzzom Offers Featured User Options
This is when discovered this great new way to grow your follow list. You can pay between $10 and $100 for the number of times you want to app ar at the top of the list.
Re: Microsoft Test Bounties
I had spent a good deal of my time looking for someone to explain this subject clearly and I have really enjoyed reading your blog posts and I collected a lot of interesting things as well as I done a research on the subject and learn most peoples will agree with your blog.
Re: 10 Ways to Source Great Sales Leads
Hoovers.com, that have contact information for tens of millions of businesses. If necessary, you can work with these companies' research teams to order lists specifically tailored to your organization's sales needs.
Re: Microsoft Test Bounties
To find bugs and showing it to microsoft is quite admirable. Keep blogging more i will appreciate.

u comment, i follow