2012-11-13 91 views
0

我的主題隨主頁上的滑塊一起出現,上一個和下一個圖像上下移動。如何複製: 轉到my site的頁面。 點擊標題徽標進入主頁。 命中f5。這是左右漩渦應該是的地方。圖片不停地移動

主題創建者沒有迴應,也沒有任何幫助論壇。你能告訴我我應該對此做些什麼修改:

<script type="text/javascript"> 
stepcarousel.setup({ 
galleryid: 'mygallery', //id of carousel DIV 
beltclass: 'belt', //class of inner "belt" DIV containing all the panel DIVs 
panelclass: 'panel', //class of panel DIVs each holding content 
panelbehavior: {speed:400, wraparound:true, persist:true}, 
defaultbuttons: {enable: true, moveby: 3, leftnav: ['<?php bloginfo('template_directory'); ?>/images/prev.png', -90, 120], rightnav: ['<?php bloginfo('template_directory'); ?>/images/next.png', 15, 120]}, 
statusvars: ['statusA', 'statusB', 'statusC'], //register 3 variables that contain current panel (start), current panel (last), and total panels 
contenttype: ['external'] //content setting ['inline'] or ['external', 'path_to_external_file'] 
}) 

</script> 

我可以用CSS來做些什麼來修正位置嗎?

#mygallery{ padding:0;position: relative;} 

.stepcarousel{ 
position: relative; /*leave this value alone*/ 
overflow: scroll; /*leave this value alone*/ 
width: 980px; /*Width of Carousel Viewer itself*/ 
height:300px; /*Height should enough to fit largest content's height*/ 
margin:0 auto; 
padding:0; 
} 

.stepcarousel .belt{ 
position: absolute; /*leave this value alone*/ 
left: 0; 
top: 0px; 
} 

.stepcarousel .panel{ 
float: left; /*leave this value alone*/ 
overflow: hidden; /*clip content that go outside dimensions of holding panel DIV*/ 
margin:0 40px 0 0; 
border:none; 
    } 


.thumb-title{ 
top:-105px; 
right:0; 
display:block; 
position:absolute; 
width: 250px; height:68px; 
background: #eee url(images/line-h-l.png) top repeat-x; 
margin:0; 
overflow:hidden; 
text-shadow:0 1px 1px #333; 
} 



.thumb-title-clear{ 
padding:10px 20px 10px 20px; 
height:48px; 
overflow:hidden; 
} 

.thumb-title h2 a { 
display:block; 
text-decoration: none; 
font-size:16pt; 
line-height:18pt; 
height:50px; 
overflow:hidden; 
font-weight:bold; 
} 

.thumb-title h2 a:hover { 
} 



.stepcarousel .slideimg{ 
float: left; /*leave this value alone*/ 
background: #000 /*clip content that go outside dimensions of holding panel DIV*/ 
margin:0; /*margin around each panel*/ 
padding:0; 
width:300px; 
height:300px; 
overflow:hidden; 
border-radius:15px; 
-moz-border-radius:15px; /* Firefox 3.6 and earlier */ 
} 
+0

嘗試改變** moveby:3 **與任何其他號碼,看看會發生什麼。 –

+0

他們不會在Chrome中爲我跳。你解決了這個問題嗎? – davehale23

+0

移動:3將滑塊移動3個圖像。我只有3張圖片,因此不會移動。 – user1761865

回答

0

好的,這是我注意到的。我可以像這樣在你的頁面上重現問題:如果我F5頁面,那麼一切看起來都很好。如果我然後調整瀏覽器的大小,圖像會立即出現在錯誤的位置。我看着在.js文件的意見在這裏提交http://bitsybride.com/wp-content/themes/basement/js/slider.js?ver=3.4.2,看到這第9行:

// ** 8月27日,08'-導航按鈕(如果啓用)也重新定位自己 現在如果調整窗口

我開始尋找在.js文件和發現,如果我刪除101-105:

$(window).bind("load, resize", function(){ //refresh position of nav buttons when page loads/resizes, in case offsets weren't available document.oncontentload 
    config.offsets={left:stepcarousel.getoffset(config.$gallery.get(0), "offsetLeft"), top:stepcarousel.getoffset(config.$gallery.get(0), "offsetTop")} 
    config.$leftnavbutton.css({left:config.offsets.left+config.defaultbuttons.leftnav[1]+'px', top:config.offsets.top+config.defaultbuttons.leftnav[2]+'px'}) 
    config.$rightnavbutton.css({left:config.offsets.left+config.$gallery.get(0).offsetWidth+config.defaultbuttons.rightnav[1]+'px', top:config.offsets.top+config.defaultbuttons.rightnav[2]+'px'}) 
}) 

的左/右漩渦將不再「跳」時,裝載或調整時。我瀏覽了代碼,發現「offsetTop」正在被改變。

所以。 。 。所有這一切說,嘗試編輯您的安裝腳本,以包括一個特定的「offsetTop」。我認爲這是代碼中的某個地方被「猜到」了。它看起來完全一樣:

stepcarousel.setup({ 
    galleryid: 'mygallery', //id of carousel DIV 
    beltclass: 'belt', //class of inner "belt" DIV containing all the panel DIVs 
    panelclass: 'panel', //class of panel DIVs each holding content 
    panelbehavior: {speed:400, wraparound:true, persist:true}, 
    defaultbuttons: {offsetTop: 242, enable: true, leftnav: ['http://bitsybride.com/wp-content/themes/basement/images/prev.png', -90, 120], rightnav: ['http://bitsybride.com/wp-content/themes/basement/images/next.png', 15, 120]}, 
    statusvars: ['statusA', 'statusB', 'statusC'], //register 3 variables that contain current panel (start), current panel (last), and total panels 
    contenttype: ['external'] //content setting ['inline'] or ['external', 'path_to_external_file'] 
}) 
+0

不,不幸的是它沒有工作。另外,當我從.js文件中刪除這些行(只是爲了看看會發生什麼)時,漩渦完全消失了。 – user1761865

+0

好的。我刪除了正確的部分。現在它們垂直固定但水平移動。他們似乎被錨定在左側。任何想法如何解決? – user1761865