text on hover...

need code to show text on hoover over img.

Page 1 of 1

1 Replies - 1849 Views - Last Post: 10 January 2011 - 06:42 PM

#1 qjianq24dream   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 10-January 11

text on hover...

Posted 10 January 2011 - 06:32 PM

I have found this random image generator. It works well enough for my needs, but now I need the image that this code below generates to have an opportunity to present some simple text to describe what the image it. Basically, if the image is that of a shoe then the text that appears upon hoovering on image would say "jimmy cho' shoes".

can someone help me? I have tried be keep messing it up.

<script language="Javascript">
<!--
/*
Random Image Link Script
By Website Abstraction (http://www.wsabstract.com)
and Java-scripts.net (http://www.java-scripts.net)
*/

function random_imglink(){
  var myimages=new Array()
  //specify random images below. You can have as many as you wish
  myimages[1]="http://www.Yo.com/images/nneka.jpg"
  myimages[2]="http://www.Yo.com/images/aprilsmith.jpg"
  myimages[3]="http://www.Yo.com/images/hestaprynn.jpg"
 "
  
  //specify corresponding links below
  var imagelinks=new Array()
  imagelinks[1]="http://www.nnekaworld.com/"
  imagelinks[2]="http://www.aprilsmithmusic.com/"
  imagelinks[3]="http://www.hestaprynn.com/"
  i
  var ry=Math.floor(Math.random()*myimages.length)

  if (ry==0)
     ry=1
     document.write('<a href='+'"'+imagelinks[ry]+'"'+'><img src="'+myimages[ry]+'" border=0></a>')
}


This post has been edited by macosxnerd101: 10 January 2011 - 06:37 PM
Reason for edit:: Please use code tags


Is This A Good Question/Topic? 0
  • +

Replies To: text on hover...

#2 Dormilich   User is offline

  • 痛覚残留
  • member icon

Reputation: 4192
  • View blog
  • Posts: 13,244
  • Joined: 08-June 10

Re: text on hover...

Posted 10 January 2011 - 06:42 PM

the easiest and simplest way is putting that in the image’s title attribute.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1