首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >prettyPhoto破坏了其他js

prettyPhoto破坏了其他js
EN

Stack Overflow用户
提问于 2013-04-22 17:59:38
回答 1查看 476关注 0票数 0

我使用prettyPhoto来显示我的照片,但当我使用它时,它会破坏其他js。

代码语言:javascript
复制
    <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()的代码是

代码语言:javascript
复制
   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();
 }

有谁可以帮我?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-04-25 17:32:14

我使用回调。

代码语言:javascript
复制
 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' });
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16144273

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档