first commit
هذا الالتزام موجود في:
92
html/gdsImageSwapping.js
Normal file
92
html/gdsImageSwapping.js
Normal file
@@ -0,0 +1,92 @@
|
||||
<!--
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//
|
||||
|
||||
// JavaScript Image Rollover Script -
|
||||
|
||||
//
|
||||
|
||||
// This file provides for multiple image states including image rollover
|
||||
|
||||
// functionality (onMouseover,onMouseout) along with persistent states (onClick).
|
||||
|
||||
// To use, declare each of the images that will have multiple states using the
|
||||
|
||||
// gdsObjImg function. This function takes four parameters: image tag name, url of
|
||||
|
||||
// the image's off state, url of the image's over state, and url of the image's
|
||||
|
||||
// on state. Insert each of the declared images into the imageArray array. In
|
||||
|
||||
// the HTML, make sure to include the 'NAME' attribute for the image tags that
|
||||
|
||||
// correspond to the declared images.
|
||||
|
||||
//
|
||||
|
||||
// Usage:
|
||||
|
||||
// ( in the <HEAD> )
|
||||
|
||||
// <script language="JavaScript" src="imageSwapping.js"></script>
|
||||
|
||||
// <script language="JavaScript">
|
||||
|
||||
// imgOne = new objImg('imageOneName','images/imageoneoff.gif','images/imageoneover.gif','images/imageoneon.gif');
|
||||
|
||||
// imgTwo = new objImg('imageTwoName','images/imagetwooff.gif','images/imagetwoover.gif','images/imagetwoon.gif');
|
||||
|
||||
//
|
||||
|
||||
// imageArray = new Array(imgOne,imgTwo);
|
||||
|
||||
// </script>
|
||||
|
||||
//
|
||||
|
||||
// ( in the <BODY> )
|
||||
|
||||
// <a href="#" onClick="gdsSwapImg(imgOne,'on');"><img name="imageOneName" src="images/imageoneoff.gif"></a>
|
||||
|
||||
//
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
// DO NOT EDIT BELOW THIS LINE
|
||||
|
||||
function gdsLoadImg(URL)
|
||||
|
||||
{
|
||||
|
||||
if (document.images)
|
||||
|
||||
{
|
||||
|
||||
newImg = new Image();
|
||||
|
||||
newImg.src = URL;
|
||||
|
||||
return newImg;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function gdsObjImg(imgName,offImgURL,overImgURL,onImgURL)
|
||||
|
||||
{
|
||||
|
||||
this.name = imgName
|
||||
|
||||
this.state = "off";
|
||||
|
||||
if (offImgURL) {this.offImg = gdsLoadImg(offImgURL);}
|
||||
|
||||
if (overImgURL) {this.overImg = gdsLoadImg(overImgURL);}
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم