1).html file>>>it has one function defined inside it that is changeIt() that works on the page loads.
2).js file >>>it has 1 functions that is changeeIt() and it works at the image click...
Both are working well for single image,but i want to all more image on the same page.. so how to make the use of these function at images
1)the coding of html file is as under>>>.
Expand|Select|Wrap|Line Numbers
- <html>
- <head>
- <script language="javascript" src="C:\Documents and Settings\Administrator\Desktop\external.js"></script>
- <script langauge="javascript">
- function changeIt()
- {
- var width=50;
- var height=50;
- document.image.width=width
- document.image.height=height
- }
- </script>
- </head>
- <body>
- <body onload="changeIt();">
- <img src="C:\Documents and Settings\Administrator\Desktop\a.jpg" name="image" onclick="changeeIt();">
- </body>
- </html>
Expand|Select|Wrap|Line Numbers
- var count=1;
- function changeeIt()
- {
- if(count==1)
- {
- var width=500
- var height=500
- document.image.width=width
- document.image.height=height
- count=2;
- }
- else if(count==2)
- {
- var amrit1=50
- var pal=50
- document.image.width=amrit1
- document.image.height=pal
- count=1;
- }
- }
Thanks in advance