0

我正在使用 jQuery Banner Rotator 插件,并让它在 html 页面上正常工作。但是,当我将它复制到我的 site.master 时,我收到一个 javascript 错误,提示“对象不支持属性或方法“allinone_bannerrotator”。

两个文档的 head 部分是相同的:

<head>
<title></title>
<!--[if !IE 7]>
    <style type="text/css">
        #wrap {display:table;height:100%}
    </style>
<![endif]-->
<link href="Styles/Site.css" rel="stylesheet" type="text/css" />
<link href="Styles/allinone_bannerRotator.css" rel="stylesheet" type="text/css" />
<link href='http://fonts.googleapis.com/css?family=Droid+Sans' rel='stylesheet' type='text/css' />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script src="Scripts/jquery-ui-1.8.16.custom.min.js" type="text/javascript"></script>
<script src="Scripts/jquery.ui.touch-punch.min.js" type="text/javascript"></script>
<script src="Scripts/allinone_bannerRotator.js" type="text/javascript"></script>
<script>
    $(function () {

        $('#allinone_bannerRotator_classic').allinone_bannerRotator({
            skin: 'classic',
            width: 751,
            height: 229,
            thumbsFolder: 'images/classic/thumbs'
        });


    });
</script>

除了 site.master 具有 runat="server" 标记和其中的内容占位符:

<asp:ContentPlaceHolder ID="HeadContent" runat="server">
</asp:ContentPlaceHolder>

这是横幅的代码:

<div id="allinone_bannerRotator_classic" style="display: none; margin: 0px">
                            <!-- IMAGES -->
                            <img src="images/classic/banner1.png" alt="" data-text-id="#allinone_bannerRotator_photoText1" />
                            <img src="images/classic/banner2.png" alt="" data-text-id="#allinone_bannerRotator_photoText2" />
                            <img src="images/classic/banner3.png" alt="" data-text-id="#allinone_bannerRotator_photoText3" />
                            <img src="images/classic/banner4.png" alt="" data-text-id="#allinone_bannerRotator_photoText4" />
                            <!-- TEXTS -->
                            <div id="allinone_bannerRotator_photoText1" class="allinone_bannerRotator_texts">
                                <div class="allinone_bannerRotator_text_line textElement12_attractive" data-initial-left="50"
                                    data-initial-top="10" data-final-left="50" data-final-top="40" data-duration="0.5"
                                    data-fade-start="0" data-delay="0">
                                    Broadoak students love to
                                </div>
                                <div class="allinone_bannerRotator_text_line textElement11_attractive" data-initial-left="50"
                                    data-initial-top="10" data-final-left="50" data-final-top="70" data-duration="0.5"
                                    data-fade-start="0" data-delay="0.3">
                                    get stuck in</div>
                            </div>
                            <div id="allinone_bannerRotator_photoText2" class="allinone_bannerRotator_texts">
                                <div class="allinone_bannerRotator_text_line textElement12_attractive" data-initial-left="550"
                                    data-initial-top="60" data-final-left="350" data-final-top="60" data-duration="0.5"
                                    data-fade-start="0" data-delay="0">
                                    16 transition effects<br />
                                    for images</div>
                                <div class="allinone_bannerRotator_text_line textElement12_attractive" data-initial-left="550"
                                    data-initial-top="125" data-final-left="350" data-final-top="125" data-duration="0.5"
                                    data-fade-start="0" data-delay="0.3">
                                    optional can set the transition<br />
                                    for each image</div>
                            </div>
                            <div id="allinone_bannerRotator_photoText3" class="allinone_bannerRotator_texts">
                                <div class="allinone_bannerRotator_text_line textElement11_attractive" data-initial-left="480"
                                    data-initial-top="60" data-final-left="50" data-final-top="60" data-duration="0.5"
                                    data-fade-start="0" data-delay="0">
                                    Animated text from any direction</div>
                                <div class="allinone_bannerRotator_text_line textElement12_attractive" data-initial-left="0"
                                    data-initial-top="75" data-final-left="50" data-final-top="75" data-duration="0.5"
                                    data-fade-start="0" data-delay="0.3">
                                    top, bottom, left and right</div>
                                <div class="allinone_bannerRotator_text_line textElement11_attractive" data-initial-left="50"
                                    data-initial-top="250" data-final-left="50" data-final-top="110" data-duration="1"
                                    data-fade-start="0" data-delay="0.5">
                                    Any color, CSS and HTML formated</div>
                            </div>
                            <div id="allinone_bannerRotator_photoText4" class="allinone_bannerRotator_texts">
                                <div class="allinone_bannerRotator_text_line textElement12_attractive" data-initial-left="50"
                                    data-initial-top="0" data-final-left="50" data-final-top="260" data-duration="0.5"
                                    data-fade-start="0" data-delay="0">
                                    Line One is here</div>
                                <div class="allinone_bannerRotator_text_line textElement11_attractive" data-initial-left="50"
                                    data-initial-top="384" data-final-left="50" data-final-top="240" data-duration="0.5"
                                    data-fade-start="0" data-delay="0.3">
                                    Line Two over there</div>
                            </div>
                        </div>

此外,html 测试页面和站点主控都位于站点结构中的同一位置,所以我认为这不是路径问题。

4

1 回答 1

0

哎呀。我在页面中包含第二个 jQuery,其级别低于 site.master(例如在我的 default.aspx 页面上)

于 2012-07-12T14:54:19.573 回答