日期:2014-05-16 浏览次数:20490 次
function Pause(obj,iMinSecond){
if (window.eventList==null) window.eventList=new Array();
var ind=-1;
for (var i=0;i<window.eventList.length;i++){
if (window.eventList[i]==null) {
window.eventList[i]=obj;
iind=i;
break;
}
}
if (ind==-1){
ind=window.eventList.length;
window.eventList[ind]=obj;
}
setTimeout("GoOn(" + ind + ")",iMinSecond);
}
//js继续函数
function GoOn(ind){
var obj=window.eventList[ind];
window.eventList[ind]=null;
if (obj.NextStep) obj.NextStep();
else obj();
}
(function($) {
$.fn.capslide = function(options) {
var opts = $.extend({}, $.fn.capslide.defaults, options);
return this.each(function() {
$this = $(this);
var o = $.meta ? $.extend({}, opts, $this.data()) : opts;
if(!o.showcaption) $this.find('.ic_caption').css('display','none');
else $this.find('.ic_text').css('display','none');
var _img = $this.find('img:first');
var w = _img.css('width');
var h = _img.css('height');
$('.ic_caption',$this).css({'color':o.caption_color,'background-color':o.caption_bgcolor,'bottom':'0px','width':w});
$('.overlay',$this).css('background-color',o.overlay_bgcolor);
$this.css({'width':w , 'height':h, 'border':o.border});
$this.hover(
function () {
Pause(this,3000);//停留3秒后执行NextStep的function
this.NextStep=function(){
if((navigator.appVersion).indexOf('MSIE 7.0') > 0)
$('.overlay',$(this)).show();
else
$('.overlay',$(this)).fadeIn();
if(!o.showcaption)
$(this).find('.ic_caption').slideDown(500);
else
$('.ic_text',$(this)).slideDown(500);
}
},
function () {
Pause(this,1000);//停留3秒后执行NextStep的function
this.NextStep=function(){
if((navigator.appVersion).indexOf('MSIE 7.0') > 0)
$('.overlay',$(this)).hide();
else
$('.overlay',$(this)).fadeOut();
if(!o.showcaption)
$(this).find('.ic_caption').slideUp(200);
else
$('.ic_text',$(this)).slideUp(200);
}
}
);
});
};
$.fn.capslide.defaults = {
caption_color : 'black',
caption_bgcolor : '#ECECEC',
overlay_bgcolor : '#ECECEC',
border : '0',
showcaption : true
};
})(jQuery);
$(function () {
$("#capslide_img_cont1").capslide({
caption_color : 'black',
caption_bgcolor : '#ECECEC',
overlay_bgcolor : '#ECECEC',
border : '0',
showcaption : true
});
$("#capslide_img_cont2").capslide({
caption_color : 'black',
caption_bgcolor : '#ECECEC',
overlay_bgcolor : '#ECECEC',
border : '0',
showcaption : true
});
});