﻿/*$(function() {
    var len = $(".num > li").length;
    var index = 0;
    var adTimer;
    $(".num li").mouseover(function() {
        index = $(".num li").index(this);
        showImg(index);
    }).eq(0).mouseover();
    //滑入 停止动画，滑出开始动画.
    $('.ad').hover(function() {
        clearInterval(adTimer);
    }, function() {
        adTimer = setInterval(function() {
            showImg(index)
            index++;
            if (index == len) { index = 0; }
        }, 6000);
    }).trigger("mouseleave");
})
// 通过控制top ，来显示不同的幻灯片
function showImg(index) {
    var adHeight = $(".flashbanner").height();
    $(".slider").stop(true, false).animate({ top: -adHeight * index }, 1000);
    $(".num li").removeClass("on")
			.eq(index).addClass("on");
}*/

(function($) {  // 滚动插件代码
    $.fn.scroll = function(options) {
        options = options || {};
        this.css('overflow', 'hidden');
        var scroll = (function(self) {
            return function() {
                if (self.data('scroll_stop')) {
                    return;
                }
                var li = self.find('li:first');
                var t = parseInt(li.css('marginTop')) || 0;
                li.animate({
                    'marginTop': (t - li.outerHeight()) + 'px'
                }, options.speed || 'slow', function() {
                    self.append(li);
                    li.css('marginTop', t + 'px');
                });
            };
        })(this);
        setInterval(scroll, options.delay || 2000);
        this.hover(function() {
            $(this).data('scroll_stop', true);
        }, function() {
            $(this).removeData('scroll_stop');
        });
    };
})(jQuery);
