2012-02-10 196 views
1

您好我正在使用Jquery PrettyPhoto,並且希望始終在彈出的幻燈片上顯示Next和Prev按鈕,而不是將用戶懸停在上面。我認爲這應該通過更改CSS來完成,但我無法弄清楚要改變哪個部分來始終顯示按鈕。Jquery PrettyPhoto - 如何總是顯示下一個上一個按鈕?

 <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> 

回答

0

你必須改變這些CSS選擇器:

div.light_squarex .pp_next:懸停{背景:網址(../圖像/ prettyPhoto/light_square/btnNextplay.png)右下角不重複;光標:指針; }/*下一個按鈕*/

div.light_squarex .pp_previous:hover {background:url(../ images/prettyPhoto/light_square/btnPrevious.png)bottom left no-repeat;光標:指針; }/*上一個按鈕*/

只要刪除:懸停和箭頭將默認情況下顯示沒有鼠標懸停。

3

試試這個,正常庫鏈接到的圖像會有類似如下:

<a href="assets/img/portfolio/work8.jpg" rel="prettyPhoto"> 

更改它讀取:

<a href="assets/img/portfolio/work8.jpg" rel="prettyPhoto[gallery]"> 

的相對= 「prettyphoto [圖庫]」 WIL確保具有該[]的所有圖像將被分組,因此默認顯示下一個和後退。

沒有它,它只會帶出一個圖像的燈箱。

+1

非常感謝! – OnengLar 2014-02-24 20:25:56

+0

謝謝!從prettyPhoto變成prettyPhoto [gallery]帶來了導航 – 2014-12-09 11:56:31

相關問題