日期:2014-05-17  浏览次数:20852 次

引用jquery库,js代码失效.
HTML code
<script type="text/javascript" src="common/jquery-1.2.6.min.js"></script>
<script type="text/javascript" src="common/jcarousellite.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<style type="text/css">
#scroll213{margin:100px;width:498px;height:143px;background:#F3F3F3;border:#E3E3E3 1px solid;padding:5px;}
#prev213{width:15px;height:72px;float:left;text-indent:-5000px;background:url(images/prev.jpg) no-repeat;cursor:pointer;margin-top:10px;}
#next213{width:15px;height:72px;float:right;text-indent:-5000px;background:url(images/next.jpg) no-repeat;cursor:pointer;margin-top:10px;}
#box213{width:440px;float:left;display:block;overflow:hidden;margin-left:5px;}
#box213 ul li{width:110px;float:left;text-align:center;}
#box213 ul li a{display:block;color:#666;padding:5px 0;}
#box213 ul li a:hover{background:#d1d1d1;color:#000;}
#box213 ul li a img{width:100px;height:80px;margin-bottom:5px;}
@charset "utf-8";/* CSS Document By Raceman 2009-10-17 17:08*/
body,h1,h2,h3,h4,h5,h6,p,ol,ul,li,dl,dt,dd{padding:0;margin:0;}
li{list-style:none;}
img{border:none;}
u{text-decoration:none;}
em{font-style:normal;}
a{color:#424242;text-decoration:none;outline:none;blr:expression(this.onFocus=this.blur());}
body{font-size:12px;font-family: Arial,Verdana, Helvetica, sans-serif; word-break:break-all;}
.box{margin:0 auto;text-align:left;width:920px;}
.clear{clear:both;}
</style>

<script type="text/javascript">
   $(document).ready(function(){
    $("#box213").jCarouselLite({
        btnPrev: "#prev213",
        btnNext: "#next213",
           auto: 4000,//图片停留时间
           scroll: 4,//每次滚动覆盖的图片个数
           speed: 1000, //设置速度,0是不动。其次就是数字越大 ,移动越慢。
           vertical: false,//横向(true),竖向(false)
           visible: 4, //显示的数量
           circular: true //是否循环
    });
});
</script>
<script type="text/javascript">

(function($) {
    $.fn.jCarouselLite = function(o) {
        o = $.extend({
            btnPrev: null, btnNext: null, btnGo: null, mouseWheel: false, auto: null, speed: 200, easing: null, vertical: false, circular: true, visible: 3, start: 0, scroll: 1, beforeStart: null, play: true,
            afterEnd: null
        }, o || {});
        return this.each(function() {
            var b = false, animCss = o.vertical ? "top" : "left", sizeCss = o.vertical ? "height" : "width";
            var c = $(this), ul = $("ul", c), tLi = $("li", ul), tl = tLi.size(), v = o.visible;
            ul.bind("mouseover", function() {
                if (o.play) {
                    o.play = false;
                }
            })
            ul.bind("mouseout", function() {
                if (!o.play) {
                    o.play = true;
                }
            })
            if (o.circular) {
                ul.prepend(tLi.slice(tl - v - 1 + 1).clone()).append(tLi.slice(0, v).clone());
                o.start += v
            }
            var f = $("li", ul), itemLength = f.size(), curr = o.start; c.css("visibility", "visible");
            f.css({ overflow: "hidden", float: o.vertical ? "none" : "left" });
            ul.css({ margin: "0", padding: "0", position: "relative", "list-style-type": "none", "z-index": "1" });
            c.css({ overflow: "hidden", position: "relative", "z-index": "2", left: "0px" });
            var g = o.vertical ? height(f) : width(f);