/**
* hSlide v0.1.1 (2010/7/15) plugin for jQuery(1.3+)
* 
* @param  timeout each animate time
* @author Zhangwei Wu <kingpro@live.cn>
* @license Dual licensed under the MIT and GPL licenses.
*/
(function ($) { $.fn.extend({ hSlide: function (timeout) { $(this).each(function () { $(this).each(function (i) { if (!$(this).is("ul")) return false; var currentSlide = 0; $(this).css({ padding: 0, margin: 0, listStyle: "none", overflow: "hidden" }); $(this).children().each(function (i) { $(this).attr("index", i); $(this).css({ padding: 0, margin: 0, float: "left", cursor: function () { return i % 2 == 0 ? "pointer" : "default"; }, overflow: "hidden" }); i % 2 == 0 ? $(this).hoverIntent({ over: function () { $(this).children().first().css({ float: function () { return $(this).parent().attr("index") < currentSlide ? "right" : "left" } }); cur = $(this).parent().children().eq(currentSlide); $(cur).next().stop().animate({ width: $(cur).children().first().width(), opacity: 0 }, timeout, function () { $(this).width(0); $(this).prev().width($(this).prev().children().first().width()); $(this).prev().animate({ opacity: 1 }, "fast"); }); $(this).stop().animate({ width: $(this).next().children().first().width(), opacity: 0 }, timeout, function () { $(this).width(0); $(this).next().width($(this).next().children().first().width()); $(this).next().animate({ opacity: 1 }, "fast"); }); currentSlide = i; }, out: function () { }, timeout: timeout }) : $(this).width(0); }); $(this).children().first().css({ width: 0, opacity: 1 }); $(this).children().first().next().width($(this).children().first().next().children().first().width()); return true; }); }); } }); })(jQuery);

