首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Jquery PrettyPhoto -如何总是显示下一个按钮?

问Jquery PrettyPhoto -如何总是显示下一个按钮?
EN

Stack Overflow用户
提问于 2012-02-10 21:23:17
回答 2查看 13.5K关注 0票数 1

嗨,我正在使用Jquery PrettyPhoto,希望总是在弹出的幻灯片上显示下一个和上一个按钮,而不是用户必须将鼠标悬停在它上面。我认为应该通过更改css来实现,但我不知道该更改哪个部分才能始终显示按钮。

代码语言:javascript
复制
      <script type="text/javascript" charset="utf-8">
        $(document).ready(function(){
            $("area[rel^='prettyPhoto']").prettyPhoto();

            $(".gallery:first a[rel^='prettyPhoto']").prettyPhoto({animation_speed:'slow',theme:'light_squarex',slideshow:3000, autoplay_slideshow: false});
            $(".gallery:gt(0) a[rel^='prettyPhoto']").prettyPhoto({animation_speed:'slow',slideshow:10000, hideflash: true});



            $("#custom_content a[rel^='prettyPhoto']:first").prettyPhoto({
                custom_markup: '<div id="map_canvas" style="width:260px; height:265px"></div>',
                changepicturecallback: function(){ initialize(); }
            });

            $("#custom_content a[rel^='prettyPhoto']:last").prettyPhoto({
                custom_markup: '<div id="bsap_1259344" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6"></div><div id="bsap_1237859" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6" style="height:260px"></div><div id="bsap_1251710" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6"></div>',
                changepicturecallback: function(){ _bsap.exec(); }
            });

        });
        </script>
         <style>
      div.light_squarex .pp_left ,
div.light_squarex .pp_middle,
div.light_squarex .pp_right,
div.light_squarex .pp_content { background: #fff; }

div.light_squarex .pp_content .ppt { color: #000; }
div.light_squarex .pp_expand { background: url(../images/prettyPhoto/light_square/sprite.png) -31px -26px no-repeat; cursor: pointer; } /* Expand button */
div.light_squarex .pp_expand:hover { background: url(../images/prettyPhoto/light_square/sprite.png) -31px -47px no-repeat; cursor: pointer; } /* Expand button hover */
div.light_squarex .pp_contract { background: url(../images/prettyPhoto/light_square/sprite.png) 0 -26px no-repeat; cursor: pointer; } /* Contract button */
div.light_squarex .pp_contract:hover { background: url(../images/prettyPhoto/light_square/sprite.png) 0 -47px no-repeat; cursor: pointer; } /* Contract button hover */
div.light_squarex .pp_close { width: 75px; height: 22px; background: url(../images/prettyPhoto/light_square/sprite.png) -1px -1px no-repeat; cursor: pointer; } /* Close button */
div.light_squarex .pp_details { position: relative; }
div.light_squarex .pp_description { margin-right: 85px; }
div.light_squarex #pp_full_res .pp_inline { color: #000; }
div.light_squarex .pp_gallery a.pp_arrow_previous,
div.light_squarex .pp_gallery a.pp_arrow_next { margin-top: 12px !important; }
div.light_squarex .pp_nav .pp_play { background: url(../images/prettyPhoto/light_square/sprite.png) -1px -100px no-repeat; height: 15px; width: 14px; }
div.light_squarex .pp_nav .pp_pause { background: url(../images/prettyPhoto/light_square/sprite.png) -24px -100px no-repeat; height: 15px; width: 14px; }

div.light_squarex .pp_arrow_previous { background: url(../images/prettyPhoto/light_square/sprite.png) 0 -71px no-repeat; } /* The previous arrow in the bottom nav */
    div.light_squarex .pp_arrow_previous.disabled { background-position: 0 -87px; cursor: default; }
div.light_squarex .pp_arrow_next { background: url(../images/prettyPhoto/light_square/sprite.png) -22px -71px no-repeat; } /* The next arrow in the bottom nav */
    div.light_squarex .pp_arrow_next.disabled { background-position: -22px -87px; cursor: default; }

div.light_squarex .pp_next:hover { background: url(../images/prettyPhoto/light_square/btnNextplay.png) bottom right  no-repeat; cursor: pointer; } /* Next button */
div.light_squarex .pp_previous:hover { background: url(../images/prettyPhoto/light_square/btnPrevious.png) bottom left no-repeat; cursor: pointer; } /* Previous button */

div.light_squarex .pp_loaderIcon { background: url(../images/prettyPhoto/light_rounded/loader.gif) center center no-repeat; } /* Loader icon */ </style>
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2012-02-10 21:35:18

您必须更改这些CSS选择器:

指针{背景: url(../images/prettyPhoto/light_square/btnNextplay.png)右下角无重复;div.light_squarex:.pp_next:hover;} /*下一步按钮*/

指针{背景: url(../images/prettyPhoto/light_square/btnPrevious.png)左下角无重复;div.light_squarex:.pp_previous:hover;} /*上一步按钮*/

只需移除:hover,箭头将默认显示,而无需鼠标悬停。

票数 0
EN

Stack Overflow用户

发布于 2013-03-14 23:40:49

试试这个,图片的普通图库链接将会有类似如下的内容:

代码语言:javascript
复制
<a href="assets/img/portfolio/work8.jpg" rel="prettyPhoto">

将其更改为:

代码语言:javascript
复制
<a href="assets/img/portfolio/work8.jpg" rel="prettyPhoto[gallery]">

Rel=“漂亮的图片库”将确保所有包含该图片的图片将被分组,因此默认情况下会显示下一个和后面的图片。

如果没有它,它只会显示包含一个图像的lightbox。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9228451

复制
相关文章

相似问题

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