Log In · Register

 
Can someone teach me how to do rollovers?
Nikki09815
post May 11 2008, 09:37 AM
Post #1


Member
**

Group: Official Designer
Posts: 11
Joined: Jun 2006
Member No: 425,348



I've looked for some tutorials on them, but I can't seem to find any that I can actually follow.
Can someone, by chance, teach me how?
 
 
Start new topic
Replies
Melissa
post May 11 2008, 11:59 AM
Post #2


;)
******

Group: Duplicate
Posts: 2,374
Joined: Feb 2004
Member No: 3,760



There's also this script if you want an image swap rollover:

CODE
<script language="javascript">
<!-- hide script from old browsers

//detect browser:
browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);
if (browserName == "Netscape" && browserVer >= 3) browserVer = "1";
else if (browserName == "Microsoft Internet Explorer" && browserVer == 4) browserVer = "1";
else browserVer = "2";

//preload images:
if (browserVer == 1) {
a1 = new Image(WIDTH,HEIGHT);
a1.src = "FIRST IMAGE URL";
a2 = new Image(WIDTH,HEIGHT);
a2.src = "ROLLOVER IMAGE URL";

//you can add more as b,c,d,etc.}

//image swapping function:
function hiLite(imgDocID, imgObjName, comment) {
if (browserVer == 1) {
document.images[imgDocID].src = eval(imgObjName + ".src");
window.status = comment; return true;
}}
//end hiding -->
</script>


and then the code:
CODE
<img src="FIRST IMAGE URL" name="a" onMouseOver="hiLite('a','a2','opt title')" onMouseOut="hiLite('a','a1','opt title')">


Try looking on Dynamic Drive: http://www.dynamicdrive.com/dynamicindex15/domroll.htm
 

Posts in this topic


Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: