Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. JavaScript
  4. alt attribute displayed when mouse leave

alt attribute displayed when mouse leave

Scheduled Pinned Locked Moved JavaScript
csharpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dada2010
    wrote on last edited by
    #1

    Hello everybody I have a strange behaviour on an image link with hover image. When we click and then leave (quickly) the link, the alt is dispayed like if there was no image = alt attribute is displayed, just before new page is openned. to reproduce : http://jsfiddle.net/BuETP/1/[^] click the button and just leave it quicky. "alt" attribute is displayed about 1/2 second... Can't reproduce it on IE, just in Chrome. Have you an idea on what i'm doing wrong ? Thanks very much !

    T 1 Reply Last reply
    0
    • D dada2010

      Hello everybody I have a strange behaviour on an image link with hover image. When we click and then leave (quickly) the link, the alt is dispayed like if there was no image = alt attribute is displayed, just before new page is openned. to reproduce : http://jsfiddle.net/BuETP/1/[^] click the button and just leave it quicky. "alt" attribute is displayed about 1/2 second... Can't reproduce it on IE, just in Chrome. Have you an idea on what i'm doing wrong ? Thanks very much !

      T Offline
      T Offline
      twseitex
      wrote on last edited by
      #2

      you mean that in pure HTML and JavaScript alttt please use attribut TILE too (value of TITLE should be not hte same like value of ALT). try onmouseover for IE onmousedown Fires when the user clicks the object with either mouse button. onmouseenter Fires when the user moves the mouse pointer into the object. onmouseleave Fires when the user moves the mouse pointer outside the boundaries of the object. onmousemove Fires when the user moves the mouse over the object. onmouseout Fires when the user moves the mouse pointer outside the boundaries of the object. onmouseover Fires when the user moves the mouse pointer into the object. onmouseup Fires when the user releases a mouse button while the mouse is over the object. onmousewheel Fires when the wheel button is rotated. ALT alt Sets or retrieves a text alternative to the graphic. SRC src Sets or retrieves a URL to be loaded by the object. ---------------------------------------------------------------------------- alttt var ImgUrlOnMouseover='http://www.html-5.com/images/click-me-hover.png'; var ImgUrlOnMouseout='http://www.html-5.com/images/click-me-normal.png'; function ImgOnMouseXXX(IDOfIMG,state) // state // true onmouseover or onmouseenter // false onmouseout { // params are unchecked var PointerOfIMG; var SrcOfIMG=ImgUrlOnMouseout; // normal var PointerOfIMG=document.getElementById(IDOfIMG); if(PointerOfIMG!=null) { if(state){SrcOfIMG=ImgUrlOnMouseover); PointerOfIMG.src=SrcOfIMG; // need time to request data of img // if you want check time state use readyState } } for IE readyState Property Internet Development Index -------------------------------------------------------------------------------- Retrieves a value that indicates the current state of the object. Syntax HTML N/A Scripting [ sState = ] object.readyState Possible Values sState String that receives one of the following values.uninitialized Object is not initialized with data. loading Object is loading its data. loaded Object

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups