我使用prettyPhoto来显示我的照片,但当我使用它时,它会破坏其他js。
<script src="/js/UItoTop/js/easing.js" type="text/javascript"></script>
<script src="/js/UItoTop/js/jquery.ui.totop.js" type="text/javascript"></script>
<link rel="stylesheet" media="screen,projection" href="/js/UItoTop/css/ui.totop.css" />
<!-- Media LightBox -->
<link rel="stylesheet" href="css/prettyPhoto.css" type="text/css" media="screen" title="prettyPhoto main stylesheet" charset="utf-8" />
<script src="js/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8"></script>
{literal}
<script type="text/javascript">
onload = function(){
readyVisorFotos();
}
</script>
<script type="text/javascript">
$(document).ready(function() {
var defaults = {
containerID: 'toTop', // fading element id
containerHoverID: 'toTopHover', // fading element hover id
scrollSpeed: 1200,
easingType: 'linear'
};
$().UItoTop({ easingType: 'easeOutQuart' });
});
</script>当我使用prettyPhoto时,UItoTop停止工作。只要您不单击任何图像来启动UItoTop,prettyPhoto就可以正常工作。
readyVisorFotos()的代码是
function readyVisorFotos(){
$("a[rel^='prettyPhoto']").prettyPhoto({show_title:false,autoplay_slideshow: true,slideshow: 5000});
$(".clipping a[rel^='prettyPhoto']").prettyPhoto({show_title:true,autoplay_slideshow: true,slideshow: 5000});
$(".noticiabrief a[rel^='prettyPhoto']").prettyPhoto();
}有谁可以帮我?
发布于 2013-04-25 17:32:14
我使用回调。
function readyVisorFotos(){
$("a[rel^='prettyPhoto']").prettyPhoto({show_title:false,autoplay_slideshow: true,slideshow: 5000,callback: function(){UItoTop();}});
$(".clipping a[rel^='prettyPhoto']").prettyPhoto({show_title:true,autoplay_slideshow: true,slideshow: 5000,callback: function(){UItoTop();}});
$(".noticiabrief a[rel^='prettyPhoto']").prettyPhoto({show_title:false,callback: function(){UItoTop();}});
}
function UItoTop(){
var defaults = {
containerID: 'toTop', // fading element id
containerHoverID: 'toTopHover', // fading element hover id
scrollSpeed: 1200,
easingType: 'linear'
};
$().UItoTop({ easingType: 'easeOutQuart' });
}https://stackoverflow.com/questions/16144273
复制相似问题