我试图将ResponsiveSlides.js集成到我的wordpress设计中,我认为我或多或少地将JQuery插件正确地迁移到Wordpress格式,但是图像由于某种原因拒绝加载。这是一个测试wordpress主题的链接我建立:
www.azletconsulting.com
我的functions.php代码在这里:
function responsive_slides() {
wp_enqueue_script( 'jquery' );
wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js');
wp_enqueue_script( 'jqueryui' );
wp_register_script( 'responsiveslides', get_template_directory_uri(). '/js/responsiveslides.min.js');
wp_enqueue_script( 'responsiveslides' );
wp_register_style('responsiveslidescss', get_template_directory_uri(). '/responsiveslides.css');
wp_enqueue_style('responsiveslidescss');
}
add_action('wp_enqueue_scripts', 'responsive_slides');
我的HTML网页代码在这里:
<section class="main">
<div class="front_slide">
<ul id="slider1" class="rslides rslides1">
<li id="rlslides1_s0" class="" style="display: block; float: none; position: absolute; opacity: 0; z-index: 1; transition: opacity 900ms ease-in-out 0s;">
<img alt="" src="<?php bloginfo('template_directory'); ?>/images/slideshow/test1.png">
</li>
<li id="rlslides1_s1" class="" style="display: block; float: none; position: absolute; opacity: 0; z-index: 1; transition: opacity 900ms ease-in-out 0s;">
<img alt="" src="<?php bloginfo('template_directory'); ?>/images/slideshow/test2.png">
</li>
<li id="rlslides1_s2" class="" style="display: block; float: none; position: absolute; opacity: 0; z-index: 1; transition: opacity 900ms ease-in-out 0s;">
<img alt="" src="<?php bloginfo('template_directory'); ?>/images/slideshow/test3.png">
</li>
<li id="rlslides1_s3" class="" style="display: block; float: none; position: absolute; opacity: 0; z-index: 1; transition: opacity 900ms ease-in-out 0s;">
<img alt="" src="<?php bloginfo('template_directory'); ?>/images/slideshow/test4.png">
</li>
</ul>
</div>
<div class="main_header">
<script type="text/javascript">
jQuery('.rslides1').responsive_slides();
</script>
<?php get_footer(); ?>
答案 0 :(得分:1)
我假设这是您正在使用的滑块? http://responsiveslides.com/
在这种情况下,请将responsive_slides()
更改为responsiveSlides()
jQuery('.rslides1').responsiveSlides();
编辑:我已将HTML内容与所有资源一起复制到本地服务器,并且我可以确认进行了那么小的更改。