Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery jCarousel和Thickbox的面向错误_Jquery_Asp.net_Thickbox - Fatal编程技术网

Jquery jCarousel和Thickbox的面向错误

Jquery jCarousel和Thickbox的面向错误,jquery,asp.net,thickbox,Jquery,Asp.net,Thickbox,错误为-“$未定义” 我从jCarousel站点获得了用于Thickbox的代码,但它不起作用。我无法找出问题所在。所以请帮我找出错误。 我正在发布我的完整代码 <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Simple_JCarousel.aspx.cs" Inherits="Carousel.JCarousel.WebForm1" %> <!DOCTYPE html PUBLIC "-//W3C

错误为-“$未定义”

我从jCarousel站点获得了用于Thickbox的代码,但它不起作用。我无法找出问题所在。所以请帮我找出错误。 我正在发布我的完整代码

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Simple_JCarousel.aspx.cs" Inherits="Carousel.JCarousel.WebForm1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript" src="../Scripts/thickbox.js"></script>
    <link rel="stylesheet" href="../Styles/thickbox.css" type="text/css" media="screen" />

    <script language="javascript" type="text/javascript" src="../Scripts/jquery-1.4.1.min.js"></script>
    <script src="../Scripts/jquery.jcarousel.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="../Styles/skin.css" />
<style type="text/css">

#mycarousel .jcarousel-item-placeholder {
    background: transparent url(../images/JQNavBtn/loading-small.gif) 50% 50% no-repeat;
}

</style>

<script type="text/javascript">

    // Set thickbox loading image
    tb_pathToImage = "../images/img/loadingAnimation.gif";

    var mycarousel_itemList = [
    { url: "../images/1.jpg", title: "Flower1" },
    { url: "../images/2.jpg", title: "Flower2" },
    { url: "../images/3.jpg", title: "Flower3" },
    { url: "../images/4.jpg", title: "Flower4" },
    { url: "../images/5.jpg", title: "Flower5" },
    { url: "../images/6.jpg", title: "Flower6" },
    { url: "../images/7.jpg", title: "Flower7" },
    { url: "../images/8.jpg", title: "Flower8" }

];

    function mycarousel_itemLoadCallback(carousel, state) {
        for (var i = carousel.first; i <= carousel.last; i++) {
            if (carousel.has(i)) {
                continue;
            }

            if (i > mycarousel_itemList.length) {
                break;
            }

            // Create an object from HTML
            var item = jQuery(mycarousel_getItemHTML(mycarousel_itemList[i - 1])).get(0);

            // Apply thickbox
            tb_init(item);

            carousel.add(i, item);
        }
        ShowImage();
    };

    /**
    * Item html creation helper.
    */
    function mycarousel_getItemHTML(item) {
        var url_m = item.url.replace(/_s.jpg/g, '_m.jpg');
        return '<a href="' + url_m + '" title="' + item.title + '"><img src="' + item.url + '" width="75" height="75" border="0" alt="' + item.title + '" /></a>';
    };

    jQuery(document).ready(function () {
        jQuery('#mycarousel').jcarousel({
            size: mycarousel_itemList.length,
            itemLoadCallback: { onBeforeAnimation: mycarousel_itemLoadCallback }
        });

        ShowImage();
    });

    function ShowImage() {
        jQuery('#mycarousel img').mouseover(function () {
            var img = '<img src="' + this.src + '" />';
            jQuery('#showImageArea').html(img);
        });

    }
</script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <ul id="mycarousel" class="jcarousel-skin-ie7">
     <!-- The content will be dynamically loaded in here -->
     </ul>

    </div>
    <br /><br /><br /><br /><br /><br /><br /><br /><br />
    <div id="showImageArea"></div>
    </form>
</body>
</html>

#mycarousel.jcarousel项目占位符{
背景:透明url(../images/JQNavBtn/loading small.gif)50%50%无重复;
}
//设置thickbox加载图像
tb_pathToImage=“../images/img/loadingAnimation.gif”;
var mycarousel_itemList=[
{url:“../images/1.jpg”,标题:“Flower1”},
{url:“../images/2.jpg”,标题:“Flower2”},
{url:“../images/3.jpg”,标题:“Flower3”},
{url:“../images/4.jpg”,标题:“Flower4”},
{url:“../images/5.jpg”,标题:“Flower5”},
{url:../images/6.jpg”,标题:“Flower6”},
{url:../images/7.jpg”,标题:“Flower7”},
{url:“../images/8.jpg”,标题:“Flower8”}
];
函数mycarousel_itemLoadCallback(carousel,state){
for(var i=carousel.first;i mycarousel_itemList.length){
打破
}
//从HTML创建对象
var item=jQuery(mycarousel\u getItemHTML(mycarousel\u itemList[i-1]).get(0);
//应用thickbox
tb_init(项目);
转盘。添加(i,项目);
}
ShowImage();
};
/**
*项目html创建助手。
*/
函数mycarousel_getItemHTML(项目){
var url_m=item.url.replace(/_.jpg/g,“_m.jpg”);
返回“”;
};
jQuery(文档).ready(函数(){
jQuery(“#mycarousel”).jcarousel({
大小:mycarousel_itemList.length,
itemLoadCallback:{onBeforeAnimation:mycarousel_itemLoadCallback}
});
ShowImage();
});
函数ShowImage(){
jQuery('#mycarousel img').mouseover(函数(){
var img=“”;
jQuery('#showImageArea').html(img);
});
}













加载jquery后,需要加载thickbox,然后将js放入ready函数

更改此项:

    <script type="text/javascript" src="../Scripts/thickbox.js"></script>
    <link rel="stylesheet" href="../Styles/thickbox.css" type="text/css" media="screen" />

    <script language="javascript" type="text/javascript" src="../Scripts/jquery-1.4.1.min.js"></script>
    <script src="../Scripts/jquery.jcarousel.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="../Styles/skin.css" />

将jquery引用放在jcarousel引用之前。因为Jcarousel使用jquery库和。。。所以Jquery需要先实例化。

请正确格式化代码并发布。那是一个眼睛痛。也要聪明一点,只粘贴相关代码。e、 g.我看不出您在哪里实例化了旋转木马。你为什么要粘贴整个旋转木马代码?我认为这是一个插件,可以正常工作。
    <script language="javascript" type="text/javascript" src="../Scripts/jquery-1.4.1.min.js"></script>
    <script src="../Scripts/jquery.jcarousel.min.js" type="text/javascript"></script>
    <link rel="stylesheet" type="text/css" href="../Styles/skin.css" />
    <script type="text/javascript" src="../Scripts/thickbox.js"></script>
    <link rel="stylesheet" href="../Styles/thickbox.css" type="text/css" media="screen" />
 jQuery(document).ready(function () {
        // put ALL js in here
    });