網頁Banner圖片切換js的使用

紋路貓發表於2012-10-25
        <script src="../js/jquery1.7.0.js" type="text/javascript"></script>
    <script src="../WebJs/CommentJs/focus.js" type="text/javascript"></script>
    <script src="../WebJs/CommentJs/passport.js" type="text/javascript"></script>
    <script src="../WebJs/ControlJs/header.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div id="Main">
        <div id="Header">
            <uc1:header ID="header1" runat="server" />
        </div>
        <div id="Content" class="box">
           <div id="divLeft" class="box">
              <!--圖片切換-->
              <div id="pic" class="box">
                    <div class="sub_box">
                      <div id="p-select" class="sub_nav">
                        <div class="sub_no" id="bd1lfsj">
                          <ul>
                            <li class="show">
                              1
                            </li>
                            <li class="">
                               2
                            </li>
                          </ul>
                        </div>
                      </div>
                      <div id="bd1lfimg">
                        <div>
                          <dl class="show">
                          </dl>
                          <dl class="">
                            <dt>
                              <a href="#" title="" target="_blank">
                                <img src="../images/ad2.png" />
                              </a>
                            </dt>
                            <dd>
                              <h2>
                                <a href="#" target="_blank">
                                 sdfsdf
                                </a>
                              </h2>
                            </dd>
                          </dl>
                        </div>
                        <div>
                          <dl class="show">
                          </dl>
                          <dl class="">
                            <dt>
                              <a href="#" title="" target="_blank">
                                <img src="../images/ad2.png" />
                              </a>
                            </dt>
                            <dd>
                              <h2>
                                <a href="#" target="_blank">
                                 sdfsdf
                                </a>
                              </h2>
                            </dd>
                          </dl>
                        </div>
                      </div>
                      <script type="text/javascript">
                       <span style="color:#ff0000;"> movec();</span>
                      </script>
                    </div>
                </div>
           </div>


這樣放置程式碼才有效果,但是把js放置在前面會阻塞圖片的載入,所以可以這樣:

        <div id="Footer" style="margin-top:20px;">
            <uc2:footer ID="footer1" runat="server" />
        </div>
    </div>
    </form>
    <script src="../js/jquery1.7.0.js" type="text/javascript"></script>
    <script src="../WebJs/CommentJs/focus.js" type="text/javascript"></script>
    <script src="../WebJs/CommentJs/passport.js" type="text/javascript"></script>
    <script src="../WebJs/ControlJs/header.js" type="text/javascript"></script>
</body>
</html>

可以把紅色的“movec()”放到passport.js裡面



相關文章