|
||||||
| Javascript Javascript Tutorials and Code |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||||
|
Introduction:-
In this tutorial I will show you how to change the image when the user puts the cursor over an image and then change it back when the user puts the cursor away from the image. Solution:- Make These Two Functions Between The <head> tags:- Code:
<SCRIPT language="JavaScript">
if (document.images)
{
img1on= new Image(100,100);
img1on.src="img2.jpg";
img1off= new Image(100,100);
img1off.src="img1.jpg";
}
function change(imgName)
{
if (document.images)
{
imgOn=eval(imgName + "on.src");
document[imgName].src= imgOn;
}
}
function changeback(imgName)
{
if (document.images)
{
imgOff=eval(imgName + "off.src");
document[imgName].src= imgOff;
}
}
</SCRIPT>
Code:
<A onMouseover="change('img1')" onMouseout="changeback('img1')">
<IMG SRC="img1.jpg" name="img1" width="100" height="100"></A>
![]() Explanation:- You think it is needed? I think its self explanatory. But if you have any problems.. just ask A Preview:- ![]() Conclusion:- As Always Feedback is welcome and the full source is attached!!
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall ![]() Business Directory | Technology Blog | Windows Help Last edited by TcM; 12-03-2006 at 12:30 PM. |
| Sponsored Links |
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to make image straight - Photoshop | ahsan16 | Photoshop Tutorials | 7 | 06-20-2008 10:38 AM |
| How to change the hostname in Windows XP | navghost | General Programming | 2 | 06-01-2007 11:47 AM |
| Resize Images And Maintain Original Sharpness | AfTriX | Photoshop Tutorials | 7 | 04-20-2007 09:55 AM |
| Using change management | Cosmet | General Programming | 2 | 10-30-2006 06:16 PM |
| Change design to make more $ | Montecarlo | Website Design | 11 | 07-13-2006 12:05 PM |