Answer the question
In order to leave comments, you need to log in
jQuery not setting onmouseover and onmouseout attributes in google chrome?
On the onload event, a function is hung that reduces large images on the page.
When you hover over the mouse, the picture should become the original size. If doing so
$(this).attr({<br>
width: width_resized,<br>
onmouseover: '$(this).attr("width", ' + width + ');',<br>
onmouseout: '$(this).attr("width", ' + width_resized + ');' <br>
});<br>
$(this).attr("onmouseover", '$(this).attr("width", ' + width + ');');
Answer the question
In order to leave comments, you need to log in
The problem is that you are using a non-standard jQuery API that it cannot support.
The correct way to do it is:
$(this)
.width(width_resized)
.mouseover(function () {
$(this).width(width);
})
.mouseout(function() {
$(this).width(width_resized);
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question