Lost Password?

  #1 (permalink)  
Old 12-03-2006, 12:20 PM
TcM's Avatar   
TcM TcM is offline
Moderator
 
Join Date: Aug 2006
Location: In a technologic world :p
Posts: 6,750
Rep Power: 63
TcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud of
Default JavaScript:Tutorial, MouseOver Image Change

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>
And Make This code between the <body> Tags:-

Code:
<A onMouseover="change('img1')" onMouseout="changeback('img1')">
<IMG SRC="img1.jpg" name="img1" width="100" height="100"></A>
Save your work and add these 2 images into your directory to see the effect




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!!
Attached Files To view attachments your post count must be 1 or greater. Your post count is 0 momentarily.

Last edited by TcM; 12-03-2006 at 12:30 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 02-18-2007, 08:56 PM
sahar88 sahar88 is offline
Newbie
 
Join Date: Feb 2007
Posts: 5
Rep Power: 0
sahar88 is on a distinguished road
Default

it's cool ... thank you...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 10-30-2007, 01:51 PM
cvirus cvirus is offline
Newbie
 
Join Date: Oct 2007
Posts: 2
Rep Power: 0
cvirus is on a distinguished road
Thumbs up Very Good

Very good tutorial, nice for a web site.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make image straight - Photoshop ahsan16 Photoshop Tutorials 56 07-30-2008 03:11 PM
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


All times are GMT -5. The time now is 02:06 PM.

Contest Stats

John ........ 167.00000
Xav ........ 164.00000
dargueta ........ 148.00000
gaylo565 ........ 18.00000
WingedPanther ........ 15.00000
|pH| ........ 15.00000
Johnnyboy ........ 3.00000
navghost ........ 1.00000

Contest Rules

Ads