Jquery图像缩放在Opera中工作不正常
我从StackOverflow获得了以下代码:Jquery图像缩放在Opera中工作不正常,jquery,zooming,opera,Jquery,Zooming,Opera,我从StackOverflow获得了以下代码: $(document).ready(function() { $(function(){ $('img').load(function() { $(this).data('height', this.height); }).bind('mouseenter mouseleave', function(e) { $(this).stop().animate({
$(document).ready(function() {
$(function(){
$('img').load(function() {
$(this).data('height', this.height);
}).bind('mouseenter mouseleave', function(e) {
$(this).stop().animate({
height: $(this).data('height') *
(e.type === 'mouseenter' ? 1.5 : 1)
});
});
});
});
它适用于IE、Chrome、Firefox和Opera。但在Opera中,它只在我第一次进入页面时起作用(如果我在地址栏中键入链接)。
我有一个4页的站点,当我从另一个页面转到Jquery页面时,它不会在鼠标上方缩放图片。使用该方法,而不是:
顺便说一句:
$(文档).ready(function(){
等于$(function(){
给我一个到你网站的链接或创建一个请柬。否则我就帮不上忙了!这是页面的相关部分(但在JSFIDLE上不起作用)
$(function(){
$('img').each(function() {
$(this).data('height', this.height);
}).on('mouseenter mouseleave', function(e) {
$(this).stop().animate({
height: $(this).data('height') * (e.type === 'mouseenter' ? 1.5 : 1)
});
});
});