Jump to content

Recommended Posts

Hii ,

<HTML>
<HEAD>
	<TITLE>CHANGING IMAGES....</TITLE>
	<SCRIPT Language="JavaScript">
		if(document.images)	
                             rollover="yes";
		else
	                     rollover="no";
		if(rollover=="yes") {
			....code
		}
		function imageSwitchOn(imagename) {
			......
                               ....
			}
		}
		function imageSwitchOff(imagename) {
			......
                               ........
			}
		}
	</SCRIPT>
</HEAD>
<BODY>
	<H1>IMAGES......</H1><BR>
	<H3><I>place your mouse pointer on the picture</I></H3>
	<A onMouseOver="imageSwitchOn('img1')" onMouseOut="imageSwitchOff('img1')">
		<IMG Alt="space" Height=200 Name="img1" Src="Images/man2.gif" Width="200" /></A>        
</BODY>
</HTML>

I have this javascript code which toggles the images on browser when mouse cursor is moved in and out .

Now problem is I am novice & I dont understand the codes-

1)What does

 document.images

mean? I mean what is its its implication?

2)In the anchor tag 

<A onMouseOver="imageSwitchOn('img1')" onMouseOut="imageSwitchOff('img1')">

,where is the href??

Plz Help. :)

Link to comment
https://forums.phpfreaks.com/topic/266177-changing-images/
Share on other sites

It doesn't have a href, and it doesn't need one :P According to the W3, it's optional. If you'd like to give it one, it wouldn't hurt anything ;) It will change the behaviour when clicked though :D

http://www.w3.org/TR/html4/struct/links.html#h-12.2

 

document.images is a collection of all the images on the current page

http://www.webreference.com/js/column1/object.html

Link to comment
https://forums.phpfreaks.com/topic/266177-changing-images/#findComment-1364037
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.