JQuery:添加到 Blogger HTML/Javascript 小工具时代码未运行

Jquery新手

我一直在尝试为我的博主添加一个滑块(照片和文字)。我将https://codepen.io/shamim539/pen/GNqLda 中的代码添加到我的博主 html/javascript 小工具中,但它似乎不起作用。图像和文本显示在列中的单个图像和文本中,而不是滑块应该如何工作。

希望有人能帮忙。我用过的:

<!-- BLOG POSTS -->
<section class="testimonials">
<div class="container">
<div class="row">
<div class="col-sm-12">
<div id="customers-testimonials" class="owl-carousel">

<!--TESTIMONIAL 1 -->
<div class="item">
<div class="shadow-effect">
<img class="img-responsive" src="https://image.freepik.com/free-photo/dishes-with-healthy-waffles_1220-367.jpg" alt="" />
<div class="item-details">
<h5>Chicken for two Roasted at this price</h5>
<p>There was a time when Chinese food in this country meant (Americanized) Cantonese food.</p>
</div>
</div>
</div>
<!--END OF TESTIMONIAL 1 -->

<!--TESTIMONIAL 2 -->
<div class="item">
<div class="shadow-effect">
<img class="img-responsive" src="https://image.freepik.com/free-photo/dishes-with-healthy-waffles_1220-367.jpg" alt="" />
<div class="item-details">
<h5>Chicken for two Roasted at this price</h5>
<p>There was a time when Chinese food in this country meant (Americanized) Cantonese food.</p>
</div>
</div>
</div>
<!--END OF TESTIMONIAL 2 -->

<!--TESTIMONIAL 3 -->
<div class="item">
<div class="shadow-effect">
<img class="img-responsive" src="https://image.freepik.com/free-photo/dishes-with-healthy-waffles_1220-367.jpg" alt="" />
<div class="item-details">
<h5>Chicken for two Roasted at this price</h5>
<p>There was a time when Chinese food in this country meant (Americanized) Cantonese food.</p>
</div>
</div>
</div>
<!--END OF TESTIMONIAL 3 -->

<style> 
.testimonials{ position: relative; padding-top: 10px; } 

#customers-testimonials{ 
.item-details{ 
background-color: #F7F6F6; 
color: #4A4A51; 
padding: 1.5em 1.5em; 
text-align: left; 
h5{ 
margin: 0 0 0.2em; 
font-size: 1.5em; 
line-height: 1.2em; 
span{ 
color: red; 
float: right; 
padding-right: 0.2em; 
} 
}
p{ font-size: 1em; } 
} 

.item { 
text-align: center; 
margin-bottom:10px; 
} 
} 

.owl-carousel .owl-nav [class*='owl-'] { 
-webkit-transition: all .3s ease; 
transition: all .3s ease; 
} 

.owl-carousel .owl-nav [class*='owl-'].disabled:hover { 
background-color: #D6D6D6; 
} 

.owl-carousel { 
position: relative; 
} 

.owl-carousel .owl-next, .owl-carousel .owl-prev { 
width: 50px; 
height: 50px; 
line-height: 50px; 
border-radius: 50%; 
position: absolute; 
top: 30%; 
font-size: 20px; 
color: #eee; 
border: 1px solid #eee; 
text-align: center; 
} 

.owl-carousel .owl-prev { 
left: 20px; 
} 

.owl-carousel .owl-next { 
right: 20px; 
} 
</style> 

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js" type='text/javascript'/> 
<script> 
jQuery(document).ready(function($) { 
"use strict"; 
$('#customers-testimonials').owlCarousel( { 
loop: true; 
center: true; 
items: 3; 
margin: 10; 
autoplay: false; 
dots:true; 
nav:true; 
autoplayTimeout: 8500; 
smartSpeed: 450; 
navText: ['<i class="fa fa-angle-left"></i>','<i class="fa fa-angle-right"></i>']; 
responsive: { 
0: { items: 1; }; 
768: { items: 2; }; 
1170: { items: 3; }; 
} 
}); 
}); 
</script>
斯帕什
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>owl carousel 2 testimonial slider example</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.1.1/assets/owl.carousel.min.css">
    <link rel="stylesheet" href="http://themes.audemedia.com/html/goodgrowth/css/owl.theme.default.min.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">
    <link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css'>
    <link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.1.1/assets/owl.carousel.min.css'>
    <link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css'>
    <style>
        .testimonials {
            background-color: #f33f02;
            position: relative;
            padding-top: 80px;
        }
        .testimonials:after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            width: 100%;
            height: 30%;
            background-color: #ddd;
        }
        #customers-testimonials .item-details {
            background-color: #333333;
            color: #fff;
            padding: 20px 10px;
            text-align: left;
        }
        #customers-testimonials .item-details h5 {
            margin: 0 0 15px;
            font-size: 18px;
            line-height: 18px;
        }
        #customers-testimonials .item-details h5 span {
            color: red;
            float: right;
            padding-right: 20px;
        }
        #customers-testimonials .item-details p {
            font-size: 14px;
        }
        #customers-testimonials .item {
            text-align: center;
            margin-bottom: 80px;
        }
        .owl-carousel .owl-nav [class*='owl-'] {
            transition: all .3s ease;
        }
        .owl-carousel .owl-nav [class*='owl-'].disabled:hover {
            background-color: #D6D6D6;
        }
        .owl-carousel {
            position: relative;
        }
        .owl-carousel .owl-next,
        .owl-carousel .owl-prev {
            width: 50px;
            height: 50px;
            line-height: 50px;
            border-radius: 50%;
            position: absolute;
            top: 30%;
            font-size: 20px;
            color: #fff;
            border: 1px solid #ddd;
            text-align: center;
        }
        .owl-carousel .owl-prev {
            left: -70px;
        }
        .owl-carousel .owl-next {
            right: -70px;
        }
    </style>
</head>
<body>
<!-- TESTIMONIALS -->
<section class="testimonials">
    <div class="container">

        <div class="row">
            <div class="col-sm-12">
                <div id="customers-testimonials" class="owl-carousel">

                    <!--TESTIMONIAL 1 -->
                    <div class="item">
                        <div class="shadow-effect">
                            <img class="img-responsive" src="https://image.freepik.com/free-photo/spaghetti-with-carbonara-sauce_1216-324.jpg" alt="">
                            <div class="item-details">
                                <h5>Chicken for two Roasted <span>$21</span></h5>
                                <p>There was a time when Chinese food in this country meant (Americanized) Cantonese food.</p>
                            </div>
                        </div>
                    </div>
                    <!--END OF TESTIMONIAL 1 -->
                    <!--TESTIMONIAL 2 -->
                    <div class="item">
                        <div class="shadow-effect">
                            <img class="img-responsive" src="https://image.freepik.com/free-photo/dishes-with-healthy-waffles_1220-367.jpg" alt="">
                            <div class="item-details">
                                <h5>Chicken for two Roasted <span>$21</span></h5>
                                <p>There was a time when Chinese food in this country meant (Americanized) Cantonese food.</p>
                            </div>
                        </div>
                    </div>
                    <!--END OF TESTIMONIAL 2 -->
                    <!--TESTIMONIAL 3 -->
                    <div class="item">
                        <div class="shadow-effect">
                            <img class="img-responsive" src="https://image.freepik.com/free-photo/top-view-of-tasty-noodles-with-prawns_1203-1769.jpg" alt="">
                            <div class="item-details">
                                <h5>Chicken for two Roasted <span>$21</span></h5>
                                <p>There was a time when Chinese food in this country meant (Americanized) Cantonese food.</p>
                            </div>
                        </div>
                    </div>
                    <!--END OF TESTIMONIAL 3 -->
                    <!--TESTIMONIAL 4 -->
                    <div class="item">
                        <div class="shadow-effect">
                            <img class="img-responsive" src="https://image.freepik.com/free-photo/burguer-with-garnish_1088-72.jpg" alt="">
                            <div class="item-details">
                                <h5>Chicken for two Roasted <span>$21</span></h5>
                                <p>There was a time when Chinese food in this country meant (Americanized) Cantonese food.</p>
                            </div>
                        </div>
                    </div>
                    <!--END OF TESTIMONIAL 4 -->
                    <!--TESTIMONIAL 5 -->
                    <div class="item">
                        <div class="shadow-effect">
                            <img class="img-responsive" src="https://image.freepik.com/free-photo/delicious-pastry-with-chicken_1203-1616.jpg" alt="">
                            <div class="item-details">
                                <h5>Chicken for two Roasted <span>$21</span></h5>
                                <p>There was a time when Chinese food in this country meant (Americanized) Cantonese food.</p>
                            </div>
                        </div>
                    </div>
                    <!--END OF TESTIMONIAL 5 -->
                </div>
            </div>
        </div>
    </div>
</section>
<!-- END OF TESTIMONIALS -->
<script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.2/jquery.min.js'></script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.1.1/owl.carousel.min.js'></script>
<script>
    jQuery(document).ready(function($) {
        "use strict";
        $('#customers-testimonials').owlCarousel( {
            loop: true,
            center: true,
            items: 3,
            margin: 30,
            autoplay: true,
            dots:true,
            nav:true,
            autoplayTimeout: 8500,
            smartSpeed: 450,
            navText: ['<i class="fa fa-angle-left"></i>','<i class="fa fa-angle-right"></i>'],
            responsive: {
                0: {
                    items: 1
                },
                768: {
                    items: 2
                },
                1170: {
                    items: 3
                }
            }
        });
    });
</script>
</body>
</html>
  1. codepen 链接为您提供了需要编译成 CSS 的 SCSS 代码。两者都是不同的,并相应地起作用。所以只需在这里复制粘贴 HTML 和 JS 部分。
  2. 您没有包含此设计所需的外部 CSS 链接。
  3. 参观并学习如何提出一个好问题谢谢 :)

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

如何小工具添加到的UpdateView在Django

来自分类Dev

如何将CSS插入CSS以用于Blogger小工具

来自分类Dev

Blogger的条件标签转换为jQuery代码

来自分类Dev

直接将选项添加到撇号图像小工具

来自分类Dev

如何将Javascript添加到Blogger页面?

来自分类Dev

如何将Javascript添加到Blogger页面?

来自分类Dev

将jQuery代码添加到wordpress

来自分类Dev

我最近更新了博客,此后,我的某些Javascript小工具在我的blogspot / blogger网站中不起作用

来自分类Dev

Blogger API示例代码

来自分类Dev

通过JQuery将工具提示添加到Bootstrap

来自分类Dev

jQuery-单击事件未添加到每个元素

来自分类Dev

输入值未添加到 keyUp jquery

来自分类Dev

如何将多个值添加到jQuery代码

来自分类Dev

如何将jQuery代码添加到HTML页面

来自分类Dev

我可以将.php文件URL添加到Blogger吗?

来自分类Dev

使用JQuery或其他工具将HTML代码添加到Image Map中

来自分类Dev

从添加到松弛按钮中检索临时代码

来自分类Dev

关于使用Bootstrap Tooltip将工具提示添加到悬停时的jQuery UI Slider的问题

来自分类Dev

将Jquery没有冲突代码添加到我当前的代码中

来自分类Dev

如何为Blogger博客添加基本样式?

来自分类Dev

jQuery如果未添加到DOM中,则无法在顶级元素中使用

来自分类Dev

jQuery将类添加到单选框未删除

来自分类Dev

如何将jQuery UI代码添加到ASP.NET Web窗体页面?

来自分类Dev

如何使用jquery ajax将css样式添加到动态加载的代码段

来自分类Dev

jQuery代码仅将tel:添加到移动浏览器

来自分类Dev

将jQuery click事件添加到生成的按钮后面的代码中

来自分类Dev

如何使用jQuery将div及其HTML代码添加到动态高度?

来自分类Dev

我应该在哪里将afterLoad添加到一些jquery代码

来自分类Dev

PHP 或 jquery 代码将对象照片添加到另一个对象照片?

Related 相关文章

  1. 1

    如何小工具添加到的UpdateView在Django

  2. 2

    如何将CSS插入CSS以用于Blogger小工具

  3. 3

    Blogger的条件标签转换为jQuery代码

  4. 4

    直接将选项添加到撇号图像小工具

  5. 5

    如何将Javascript添加到Blogger页面?

  6. 6

    如何将Javascript添加到Blogger页面?

  7. 7

    将jQuery代码添加到wordpress

  8. 8

    我最近更新了博客,此后,我的某些Javascript小工具在我的blogspot / blogger网站中不起作用

  9. 9

    Blogger API示例代码

  10. 10

    通过JQuery将工具提示添加到Bootstrap

  11. 11

    jQuery-单击事件未添加到每个元素

  12. 12

    输入值未添加到 keyUp jquery

  13. 13

    如何将多个值添加到jQuery代码

  14. 14

    如何将jQuery代码添加到HTML页面

  15. 15

    我可以将.php文件URL添加到Blogger吗?

  16. 16

    使用JQuery或其他工具将HTML代码添加到Image Map中

  17. 17

    从添加到松弛按钮中检索临时代码

  18. 18

    关于使用Bootstrap Tooltip将工具提示添加到悬停时的jQuery UI Slider的问题

  19. 19

    将Jquery没有冲突代码添加到我当前的代码中

  20. 20

    如何为Blogger博客添加基本样式?

  21. 21

    jQuery如果未添加到DOM中,则无法在顶级元素中使用

  22. 22

    jQuery将类添加到单选框未删除

  23. 23

    如何将jQuery UI代码添加到ASP.NET Web窗体页面?

  24. 24

    如何使用jquery ajax将css样式添加到动态加载的代码段

  25. 25

    jQuery代码仅将tel:添加到移动浏览器

  26. 26

    将jQuery click事件添加到生成的按钮后面的代码中

  27. 27

    如何使用jQuery将div及其HTML代码添加到动态高度?

  28. 28

    我应该在哪里将afterLoad添加到一些jquery代码

  29. 29

    PHP 或 jquery 代码将对象照片添加到另一个对象照片?

热门标签

归档