gpt4 book ai didi

javascript - ResponsiveSlides.js 和 Wordpress 图像未出现

转载 作者:行者123 更新时间:2023-12-03 10:24:53 27 4
gpt4 key购买 nike

我正在尝试将 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(); ?>

最佳答案

我假设这是您正在使用的 slider ? http://responsiveslides.com/

在这种情况下,请将 responsive_slides() 更改为 responsiveSlides()

jQuery('.rslides1').responsiveSlides();

编辑:我已将 HTML 内容连同所有资源复制到本地服务器,并且我可以确认进行这一小更改是有效的。

关于javascript - ResponsiveSlides.js 和 Wordpress 图像未出现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29453761/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com