jQuery noConflict

时间:2012-07-17 18:39:13

标签: jquery scroller

在缅因州Jan转向了解如何修复此错误。

jQuery.noConflict - 如果你删除,那么一切正常,除了thumbnailScroller。如何解决?

<script>

    function getItems() {
        alert('getItems1');

        $.get("/Product/Index", null, ajaxItems);
        alert('getItems2');
    }
    function ajaxItems(item) {
        alert(item);
        $("#index_items").replaceWith(item);
    }
</script>

<div id="create_form">
@Html.Action("Create", "Product")
</div>

@Html.Action("Index", "Product")


<script>

    jQuery.noConflict();

    (function ($) {
        window.onload = function () {
            $("#tS2").thumbnailScroller({
                scrollerType: "clickButtons",
                scrollerOrientation: "horizontal",
                scrollSpeed: 2,
                scrollEasing: "easeOutCirc",
                scrollEasingAmount: 600,
                acceleration: 4,
                scrollSpeed: 800,
                noScrollCenterSpace: 10,
                autoScrolling: 0,
                autoScrollingSpeed: 2000,
                autoScrollingEasing: "easeInOutQuad",
                autoScrollingDelay: 500
            });
        }
    })(jQuery);
</script>
<script src="@Url.Content("~/Scripts/jquery.thumbnailScroller.js")"></script>

1 个答案:

答案 0 :(得分:1)

删除jQuery.noConflict();并移动

<script src="@Url.Content("~/Scripts/jquery.thumbnailScroller.js")"></script>

在您的内联<script>标记上方。