我的jquery滑块无法正常工作 [英] My jquery slider is not working properly

查看:76
本文介绍了我的jquery滑块无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对JQuery还是很陌生,我正在尝试使此脚本正常工作.我正在尝试在客户网站的首页上创建旋转器,但无法运行它!我没有错误,文件是应有的,我无法终生弄清楚问题出在哪里!

I'm pretty new with JQuery, I'm trying to get this script to work. I'm trying to create a rotator on the homepage of a clients website but I can't get it to run! I get no errors, the files are were they're supposed to be, I can't for the life of me figure out what the problem is!

下面是一段代码:

<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="jquery.bxSlider.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
    $("form#newsletter-form").submit(function () {
        $.post("/newsletter.ajax.php", {
            action: 'subscribe',
            email: $("form#newsletter-form input#email").val()
        }, function (json) {
            if (json.success == true) {
                $("div.form-container").empty().append("<p>Thank you for submitting your info.</p>");
            } else {
                alert(json.error);
            }
        }, 'json');
        return false;

        $(function () {
            $('#show-options').click(function () {
                $('#options').slideToggle();
                $(this).toggleClass('open');
                return false;
            });
        });

        $('#slider1').bxSlider({
            infiniteLoop: false,
            auto: true,
            pager: true
        });
    });
});
</script>

滑块是我要运行的,我想知道问题是否出在它上面的功能上,还是存在冲突.

The slider is what I'm trying to get to run, I wonder if the problem has to do with the function above it or if there's a conflict.

谢谢.

推荐答案

我遇到了同样的问题,但是通过使用jQuery.noConflict解决了该问题:

I had this same problem, but resolved the issue by using jQuery.noConflict:

    var j = jQuery.noConflict();
    j(document).ready(function () {
       j('#slider1').bxSlider();
});

这篇关于我的jquery滑块无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆