大佬教程收集整理的这篇文章主要介绍了jQuery onmouseover浏览器兼容性问题,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
src
属性(或根据需要将其更改为某些图像)以强制触发load事件。
$(\'img\').each(function(){
var src = $(this).attr(\'src\');
$(this).attr(\'src\',\'#\');
$(this).attr(\'src\',src);
});
这是您固定的jsfiddle演示:http://jsfiddle.net/fwUMx/86/
自动循环浏览图像
如果您希望具有自动循环浏览图像的效果,则只需编写一些额外的函数并在动画完成回调中调用它们。这是一个有效的演示:http://jsfiddle.net/fwUMx/99/
var images = null;
var animation_speed = 500;
var wait = 1500;
function ZoomIn(element){
element.animate({
height: element.data(\'height\') * 1.5
},animation_speed,function(){
// Zoom in animation ended,schedule next image
setTimeout(function(){
ZoomOut(element);
},wait);
setTimeout(function(){
var next = element.next();
// Comment out the next line if you don\'t want the animation to restart after last image.
if(element.index() == images.length - 1) next = images.eq(0);
ZoomIn(next);
},wait);
});
}
function ZoomOut(element){
element.animate({
height: element.data(\'height\') * 1
},animation_speed);
}
function StartAnimation(){
// Make sure images object is set
if(!images) return;
ZoomIn(images.eq(0));
}
$(function(){
images = $(\'img\');
var cnt = images.length;
var loaded = 0;
images.load(function() {
$(this).data(\'height\',this.height);
loaded++;
// Start the animation after all images have loaded
if(loaded == cnt) StartAnimation();
});
// Force image load events
images.each(function(){
var src = $(this).attr(\'src\');
$(this).attr(\'src\',\'#\');
$(this).attr(\'src\',src);
});
});
以上是大佬教程为你收集整理的jQuery onmouseover浏览器兼容性问题全部内容,希望文章能够帮你解决jQuery onmouseover浏览器兼容性问题所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。