【发布时间】:2024-05-22 06:45:01
【问题描述】:
这是我当前的代码,几乎遵循specs:
<div id='my_carousel_ct' class='carousel-container'>
<div id="my_carousel_1" class="carousel slide">
<!-- Carousel items -->
<div id="my_carousel_2" class="carousel-inner rs-slider">
<?php
$Atargs = array(
'post_type' => 'attachment',
'numberposts' => -1,
'post_status' => 'any',
'post_parent' => $post->ID/*,
'exclude' => get_post_thumbnail_id()*/
);
$attachments = get_posts( $Atargs );
if ( $attachments ) {
$first = true;
foreach ( $attachments as $attachment ) {
//echo '<li><img src="'.$attachment->guid.'"></li>';
$class = $first ? "active" : "";
echo '<div class="item '. $class .'">
<div class="ts_border">
<img src="'.$attachment->guid.'" alt="'.$attachment->alt.'" />
</div>
</div>';
$first = false;
}
}
?>
</div>
<!-- Carousel nav -->
<a class="carousel-custom" href="#my_carousel_1" data-slide="prev">‹</a>
<a class="carousel-custom" href="#my_carousel_1" data-slide="next">›</a>
<div id="ts_scrol_1" class="ts_sld_scroller">
<ul>
<?php
foreach ( $attachments as $attachment ) {
$i = 0;
echo '<li>
<a href="#" class="ts_refine_st" data-to="'.$i++.'" data-slideindex="'.$i.'">
<img src="'.$attachment->guid.'" style="width:100px;height:60px;margin:0" height="60" width="100" alt="'.$attachment->guid.'" />
</a>
</li>';
}
?>
</ul>
</div>
</div>
</div>
<link rel='stylesheet' href='<?php echo get_template_directory_uri()?>/css/slider_multiple.css' />
<script type='text/javascript' src='<?php echo get_template_directory_uri()?>/js/wpts_slider_multiple.js'></script>
<script>
jQuery(document).ready(function(e) {
jQuery('#my_carousel_ct').tsSlider({
thumbs:'bottom'
, width:'475'
, showText: true
, autoplay:5000
, imgWidth: 100
, imgHeight: 100
, imgMarginTop: 0
, imgMarginLeft: 0
, squared: true
, textSquarePosition: 4
, textPosition: 'top'
, imgAlignment: 'Center'
, textColor: '999'
, skin: 'transparent'
, arrows:'ts-arrow-1'
, sliderHeight: 400
, effects:''
, titleBold: 'false'
, titleItalic: 'false'
, textBold: 'true'
, textItalic: 'false'
, textWidth: 90
, background_sld:'#FFF'
, background_caption:'#000'
});
});
</script>
但这就是滚动条的外观 (demo)
我在控制台中看不到任何错误
另外,如果我点击拇指,它不会跳转到相关幻灯片
知道我错过了什么
【问题讨论】:
标签: javascript jquery html wordpress jquery-plugins