javascript - Fading image inside a div -


I'm trying to get it when mouse moves on the div then fades the image in it

  function clickimage ($ imageid) {$ ("# image_" + imageid) .hor (function () {$ (this) .FadeTo ("slow", 1.0);}, function () { $ (This). Fedora ("slow", 0.6);}); } & Lt; Div id = 'images_ $ imageid' & gt; & Lt; A href = '? Tg = Photo & amp; Photo = $ imageid 'onmouseover = \ "javascript: clickimage (' $ imageid ') \" & gt; & Lt; Img src = 'user / $ ptgid / image / $ iimg' width = '100' height = '100' / & gt; & Lt; / A & gt; & Lt; / Div & gt;  

You want to set binding, when the document is loaded, do not mouse every time Also, I will create a square so that you can initialize the hover on each item

  $ (document) .ready (function () {$ (".- Image-hover- Fadeo ("slow", 1.0);}, function () {$ (this) fund ('img') .Fedato ("slow", 0.6);});});  

For the link, you will do something like this:

  & lt; Class = "image-hover-class" href = "? Tg = photos and photos = $ imaged" \ & gt; & Lt; Img src = 'user / $ ptgid / image / $ iimg' width = '100' height = '100' / & gt; & Lt; / A & gt;  

If you want to hover over div , then you can do it instead (but I recommend that & lt; a & Gt; tag):

  $ (document) .ready (function () {$ (".movie-hover-class"). Hover (function () {$ ( This fade ('slow', 1.0);}, function () {$ (this) .fund ('an IMG'). FEDOTO ("slow", 0.6);});}); 
& lt; A href = "? Tg = photo and photo = $ imaged" \ & gt; & Lt; Img src = 'user / $ ptgid / image / $ iimg' width = '100' height = '100' / & gt; & Lt; / A & gt; & Lt; / Div & gt;

Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -