Skip navigation
scdcomp7
Currently Being Moderated

use and image as a visited button

Jun 15, 2012 3:51 PM

Tags: #help #adobe #html #css #code #cs6_dreamweaver

Been trying to setup a roll over button thst shows the button as being visted by an image.

 

I have Dreamweaver CS6   Here is the roll over button sequence:

 

9112.jpg#1

 

The above image button is what you would see before the mouse cursor goes over.

 

The following button is what you'll see once you put your mouse cursor on it:

 

9112.jpg#2

 

And the last button you'll see once you already clicked on it:

 

91132.jpg#3

 

I am using the latest Firefox browser and from Dreamweaver - Insert - Image Objects - Rollover Image and went through the process of insert button image #1 and button image #2.

 

I've looked at the code that was generated by Dreamweaver and feel I am missing something, yet not sure what it is.

 

Any suggestions/recommendations would be a BIG help.

 

Below is the code that was generated by Dreamweaver.

 

 

 

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Untitled Document</title>

<script type="text/javascript">

function MM_swapImgRestore() { //v3.0

  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

}

function MM_preloadImages() { //v3.0

  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

}

 

function MM_findObj(n, d) { //v4.01

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

  if(!x && d.getElementById) x=d.getElementById(n); return x;

}

 

function MM_swapImage() { //v3.0

  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}

</script>

<style type="text/css">

a:visited {

    background-image: url(Country4Animal-4-web-images/91132.jpg);

}

</style>

</head>

 

<body onload="MM_preloadImages('Country4Animal-3-web-images/9112.jpg')">

<a href="http://forums.adobe.com/message/1037124#1037124" target="_blank" onmouseover="MM_swapImage('Image1','','Country4Animal-3-web-images/91 12.jpg',1)" onmouseout="MM_swapImgRestore()"><img src="Country4Animal-2-web-images/9112.jpg" width="123" height="40" id="Image1" /></a>

</body>

</html>

 
Replies

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points