473,577 Members | 3,273 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

On Mouse over- Change image help!

11 New Member
I need a very brief, easy to use code that will let me show ne picture, but change it when the user puts their mouse over the pic.

I have about 20 i need to make, so brief will be appreciated! :)
Aug 27 '08 #1
2 1459
8,658 Recognized Expert Moderator Expert
um, this depends a little bit on your html (is it an <img> or a background?) and to what the next picture should be (a specific or random image?)

basicly it works like
Expand|Select|Wrap|Line Numbers
  1. var img = img_recource // use correct DOM here
  2. img.onmousover = function() {
  3.   img.src = new_img_source // add appropriate file name here
  4. }
Aug 27 '08 #2
971 Recognized Expert Contributor
This is more of a JavaScript question it appears. Moving to the JavaScript Forum.

Aug 28 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

by: punkin | last post by:
I am trying to catch mouse position on the entire screen by dynamically generating mouse click event at every 100 ms. My code only works for IEs but not any Netscape or Gecko-based browsers. The following are the problems and I hope that there is someone who can enlighten me or give me some pointers. Also, my testing code is attached at...
by: Larry R Harrison Jr | last post by:
I am looking for javascript and a basic tutorial on how to make mouse-over drop-down menus--the type that when you "hover" over a subject links relevant to that subject "emerge" which you can then "hover" over and click. (see the links left on http://www.dpreview.com to see what I mean) I have code from smartwebby.com (DHTML) but I'm not...
by: fernandoronci | last post by:
Hi, I've been given the task of mantaining and fixing a website which I didn't design. I'm using Internet Explorer 5.5 and 6.x. Specifically, the problem is that navigation menues (written in javascript) don't disappear when the mouse moves outside of the area of the menues (some of the menues are nested two and three levels). As long as...
by: meganrobertson22 | last post by:
Hi- I'd like to try to have text displayed when I move my mouse over a command button. For example: let's say I have a form with 3 different command buttons. Each command button launches a different report. For example:
by: Nikolay Petrov | last post by:
I have a ListBox, which is binded to a DataTable. I would like to display a tooltip when the mouse cursor hovers over the items in the ListBox. I don't know how to find the index if ListBox item, on which mouse cursor is over and how to display the tooltip. Any suggestions? TIA
by: Pucca | last post by:
How can I tell a mouse right clicks over a listview item that's in a container panel. I only want to display a popup menu if the user right click the mouse over an item on the Listview. I don't not want to display this menu if a node selected on the listview but user right click over the empty space of the panel that contain the listview. ...
by: wmanzo | last post by:
I have a really professional conspiracy movie site and I use tons of layers and an external scroll bar assembly. I would like to put the various sections into MS Iframes and in order to clean up the page but I find that the iframes interfere with the getting the mouse coords from the screen which is essential in moving the scroll bar around....
by: marss | last post by:
Hi, How can I define in Firefox whether the left mouse button is pressed when I move mouse over a html element? The documentation says that "e.button == 0 for standard 'click', usually left button" http://developer.mozilla.org/en/docs/DOM:event.button Tracing of mouse clicks or mousedown/mouseup events looks not reliable, because mouse can...
by: =?Utf-8?B?QW5kcmV3?= | last post by:
I have 6 small touch screens that are connected to my pc to a special video card. The video driver splits up my screen in six sections, 3 across the top and 3 across the bottom. They are all even size. Now the video card displays a section of my screen to the corresponding touch screen. I have a separate app that release the touch(mouse)...
by: vishal1082 | last post by:
first, i don't know what could i possibly write for the "question" field... i have a button, and i put a label over it, i did that, and transparency and other things are not a problem for me, the problem is, when i take mouse over the label, the button no more has the "effect" which comes when mouse is over it (blue colored in vista/7) so what...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.