Web Analytics Made Easy -
StatCounter MouseOver text on slide images - CodingForum

Announcement

Collapse
No announcement yet.

MouseOver text on slide images

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • MouseOver text on slide images

    Please help me add in code that allow Mouse-Over image would
    display the file name of that image (but not full path).

    Thx

    ======Code=========

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html;">
    <title>Andrew 1st Month</title>
    <link rel="stylesheet" href="http://www.jasonanhkhoa.com/HTML/AndrewStyle01.css" type="text/css">

    <script type="text/javascript">
    <!--
    var imgarray = new Array();
    imgarray[imgarray.length] = new Array("http://www.jasonanhkhoa.com/Images/Andrew/2004/1stMonth/Andrew013004_08.jpg","");
    imgarray[imgarray.length] = new Array("http://www.jasonanhkhoa.com/Images/Andrew/2004/1stMonth/Andrew013004_09.jpg","");
    imgarray[imgarray.length] = new Array("http://www.jasonanhkhoa.com/Images/Andrew/2004/1stMonth/Andrew013004_10.jpg","");
    function nextimg(){

    num=(num==imgarray.length-1)?0:num+1;
    document.getElementById("change").src=imgarray[num][0];
    document.getElementById("discription").replaceChild(document.createTextNode(imgarray[num][1]), document.getElementById("discription").firstChild);}


    function previmg(){

    num=(num==0)?imgarray.length-1:num-1;
    document.getElementById("change").src=imgarray[num][0];
    document.getElementById("discription").replaceChild(document.createTextNode(imgarray[num][1]), document.getElementById("discription").firstChild);}


    function rotateimg(){

    if(n==1){

    nextimg();

    window.setTimeout("rotateimg()",time_delay);}}


    function cycleimg(){

    n=(n==0)?1:0;
    document.getElementById("cycle").value=(n==1)?"Stop Cycling Images":"Start Cycling Images";
    document.getElementById("prev").disabled=(n==1)?true:false;
    document.getElementById("next").disabled=(n==1)?true:false;

    if(n==1){window.setTimeout("rotateimg()",time_delay);}}

    //--></script>

    </head>

    <body>

    <center><BOLD><FONT FACE="ThaHuong 1.1" size=5 color=Blue>
    <div id="discription">Andrew 1st Month</div>
    <form id="control">
    <img src="http://www.jasonanhkhoa.com/Images/Andrew/2004/1stMonth/Andrew012604_01.jpg" border="0" id="change"></a><br>
    <input type="button" id="prev" class="but" onclick="previmg();" value="Previous Image">
    <input type="button" id="next" class="but" onclick="nextimg();" value="Next Image">
    <input type="button" id="cycle" class="but" onclick="cycleimg();" value="Start Cycling Images">

    </form>
    </center>
    </body>
    In The Name of Love!

  • #2
    Set title attribute of the image element to whatever string you would like to pop up.
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

    Comment


    • #3
      hello Vladdy
      Please give sample, I have tried "alt=nnnn" many places in the code but it would not show. If I set ALT in <IMG> within the FORM
      then it would show same ALT text for all images.

      Thx
      Last edited by Q2004; Feb 9, 2004, 11:40 AM.
      In The Name of Love!

      Comment

      Working...
      X