0

我正在使用 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();
 }

谁能帮我?

4

1 回答 1

0

我使用回调。

 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' });
}
于 2013-04-25T09:32:14.117 回答