Friday, 15 January 2010

onmouseover - Mouseover not working on image_tag -



onmouseover - Mouseover not working on image_tag -

i want show different image on mouse on event. code have (haml):

= image_tag(product.photos.first.asset.thumb.url, :onmouseover=> "this.src=product.photos.second.asset.thumb.url'", :onmouseout=> "this.src=product.photos.first.asset.thumb.url'")

but maintain getting "uncaught syntaxerror: unexpected token illegal" on line.

any suggestions of doing wrong? thanks!

this solution:

= image_tag(product.photos.first.asset.thumb.url, :onmouseover=> "this.src='#{product.photos.second.asset.thumb.url}'", :onmouseout=> "this.src='#{product.photos.first.asset.thumb.url}'")

onmouseover

No comments:

Post a Comment