/**
* ��ӭʹ�� kinslideshow �õ�ƭ������ͼ�����
* download by http://down.liehuo.net
* jquery kinslideshow plugin
* ========================================��˵����========================================================
* jquery�õ�ƭ���������������������ҳ��ʹ�ûõ�ƭ(����ͼ)ч��������ie6/ie7/ie8/ie9,firefox,chrome*,opera��
* ��ҫ����chrome��ҫ��img��ǩ��д��ͼƭ�ŀ�ⱥ߶�,�������������ҫ��
* ʹ�ü��䷽�㡢�������ʽ�����զ���,���嶨����ʽ��������������������μ�demo�ļ�
* ����ҫ�լ����役��ͼ��ⱥ߶ȣ��զ���ȡͼƭ��ߣ�����ͼƭ�ߴ�ҫ����һ�¡�
* ���п�ⱥ߶ȵ�λ�������أ����ò���ʱ����ҫ�ӵ�λ(px)
* ========================================================================================================
* @name jquery.kinslideshow.js
* @version 1.0
* @author mr.kin
* @date 2010-07-25
* @email:mr.kin@foxmail.com
* @qq:87190493
*
* ����ȡ���°汾kinslideshow���dz���bug���뷢��email�� ��mr.kin@foxmail.com��
*
**/
(function($) {
$.fn.kinslideshow = function(settings){
settings = jquery.extend({
intervaltime : 5, //�л�չʾ���ʱ�� ����λ���롿
movespeedtime : 400,//�л�һ��ͼƭ����ʱ�䣬����λ�����롿
movestyle:"left",//�л����� �� left | right | up | down ��left:�����л�,right:�����л�,up:�����л�,down:�����л�
mouseevent:"mouseclick", //��������ť�¼�,��mouseclick | mouseover��mouseclick����굥���л���mouseover����껬���л���
ishastitlebar:true,//�ƿ���ʾ���ⱳ����
titlebar:{titlebar_height:40,titlebar_bgcolor:"#000000"},//���ⱳ����ʽ��(ishastitlebar = true ǰ��������)
ishastitlefont:true,//�ƿ���ʾ��������
titlefont:{titlefont_size:12,titlefont_color:"#ffffff",titlefont_family:"verdana",titlefont_weight:"bold"},//����������ʽ��(ishastitlefont = true ǰ��������)
ishasbtn:true, //�ƿ���ʾ��ť
btn:{btn_bgcolor:"#666666",btn_bghovercolor:"#cc0000",btn_fontcolor:"#cccccc",btn_fonthovercolor:"#000000",btn_fontfamily:"verdana",btn_bordercolor:"#999999",btn_borderhovercolor:"#ff0000",btn_borderwidth:1} //��ť��ʽ���ã�(ishasbtn = true ǰ��������)
},settings);
var titlebar_bak = {titlebar_height:40,titlebar_bgcolor:"#000000"}
var titlefont_bak = {titlefont_size:12,titlefont_color:"#ffffff",titlefont_family:"verdana",titlefont_weight:"bold"}
var btn_bak = {btn_bgcolor:"#666666",btn_bghovercolor:"#cc0000",btn_fontcolor:"#cccccc",btn_fonthovercolor:"#000000",btn_fontfamily:"verdana",btn_bordercolor:"#999999",btn_borderhovercolor:"#ff0000",btn_borderwidth:1} //��ť��ʽ���ã�(ishasbtn = true ǰ��������)
for (var key in titlebar_bak)
{
if(settings.titlebar[key] == undefined){
settings.titlebar[key] = titlebar_bak[key];
}
}
for (var key in titlefont_bak)
{
if(settings.titlefont[key] == undefined){
settings.titlefont[key] = titlefont_bak[key];
}
}
for (var key in btn_bak)
{
if(settings.btn[key] == undefined){
settings.btn[key] = btn_bak[key];
}
}
var kinslideshow_boxobject = this;
var kinslideshow_boxobjectselector = $(kinslideshow_boxobject).selector;
var kinslideshow_datearray = new array();
var kinslideshow_imgaelength = 0;
var kinslideshow_size =new array();
var kinslideshow_changeflag = 0;
var kinslideshow_intervaltime = settings.intervaltime;
var kinslideshow_setinterval;
var kinslideshow_firstmoveflag = true;
if(isnan(kinslideshow_intervaltime) || kinslideshow_intervaltime <= 1){
kinslideshow_intervaltime = 5;
}
if(settings.movespeedtime > 500){
settings.movespeedtime = 500;
}else if(settings.movespeedtime < 100){
settings.movespeedtime = 100;
}
function kinslideshow_initialize(){
$(kinslideshow_boxobject).css({visibility:"hidden"});
$(kinslideshow_boxobjectselector+" a img").css({border:0});
kinslideshow_start();
};
function kinslideshow_start(){
kinslideshow_imgaelength = $(kinslideshow_boxobjectselector+" a").length;
kinslideshow_size.push($(kinslideshow_boxobjectselector+" a img").width());
kinslideshow_size.push($(kinslideshow_boxobjectselector+" a img").height());
$(kinslideshow_boxobjectselector+" a img").each(function(i){
kinslideshow_datearray.push($(this).attr("alt"));
});
$(kinslideshow_boxobjectselector+" a").wrapall("
");
$("#kinslideshow_content").clone().attr("id","kinslideshow_contentclone").appendto(kinslideshow_boxobject);
kinslideshow_settitlebar();
kinslideshow_settitlefont();
kinslideshow_setbtn();
kinslideshow_action();
kinslideshow_btnevent(settings.mouseevent);
$(kinslideshow_boxobject).css({visibility:"visible"});
};
function kinslideshow_settitlebar(){
$(kinslideshow_boxobject).css({width:kinslideshow_size[0],height:kinslideshow_size[1],overflow:"hidden",position:"relative"});
$(kinslideshow_boxobject).append("");
var gettitlebar_height = settings.titlebar.titlebar_height;//��ȡ���߶�
if(isnan(gettitlebar_height)){
gettitlebar_height = 40;
}else if(gettitlebar_height < 25){
gettitlebar_height = 25;
};
$(kinslideshow_boxobjectselector+" .kinslideshow_titlebar").css({height:gettitlebar_height,width:"100%",position:"absolute",bottom:0,left:0})
if(settings.ishastitlebar){
$(kinslideshow_boxobjectselector+" .kinslideshow_titlebar").css({background:settings.titlebar.titlebar_bgcolor,opacity:settings.titlebar.titlebar_alpha})
}
};
function kinslideshow_settitlefont(){
if(settings.ishastitlefont){
$(kinslideshow_boxobjectselector+" .kinslideshow_titlebar").append("");
$(kinslideshow_boxobjectselector+" .kinslideshow_titlebar .title").css({fontsize:settings.titlefont.titlefont_size,color:settings.titlefont.titlefont_color,fontfamily:settings.titlefont.titlefont_family,fontweight:settings.titlefont.titlefont_weight});
settiltfontshow(0);
};
};
function kinslideshow_setbtn(){
if(settings.btn.btn_borderwidth > 2){settings.btn.btn_borderwidth = 2}
if(settings.btn.btn_borderwidth < 0 || isnan(settings.btn.btn_borderwidth)){settings.btn.btn_borderwidth = 0}
if(settings.ishasbtn && kinslideshow_imgaelength >= 2){
$(kinslideshow_boxobject).append("");
var kinslideshow_btnlist = "";
for(i=1;i<=kinslideshow_imgaelength;i++){
kinslideshow_btnlist+=""+i+"";
}
kinslideshow_btnlist = "";
$(kinslideshow_boxobjectselector+" .kinslideshow_btnbox").append(kinslideshow_btnlist);
$(kinslideshow_boxobjectselector+" .kinslideshow_btnbox #btnlistid li").css({liststyle:"none",float:"left",width:18,height:18,borderwidth:settings.btn.btn_borderwidth,bordercolor:settings.btn.btn_bordercolor,borderstyle:"solid",background:settings.btn.btn_bgcolor,textalign:"center",cursor:"pointer",marginleft:3,fontsize:12,fontfamily:settings.btn.btn_fontfamily,lineheight:"18px",opacity:settings.btn.btn_bgalpha,color:settings.btn.btn_fontcolor});
$("#btnlistid li:eq(0)").css({background:settings.btn.btn_bghovercolor,bordercolor:settings.btn.btn_borderhovercolor,color:settings.btn.btn_fonthovercolor});
};
};
function kinslideshow_action(){
switch(settings.movestyle){
case "left": kinslideshow_moveleft(); break;
case "right": kinslideshow_moveright();break;
case "up": kinslideshow_moveup(); break;
case "down": kinslideshow_movedown(); break;
default: settings.movestyle = "left"; kinslideshow_moveleft();
}
};
function kinslideshow_moveleft(){
$(kinslideshow_boxobjectselector+" div:lt(2)").wrapall("");
$("#kinslideshow_movebox").css({width:kinslideshow_size[0],height:kinslideshow_size[1],overflow:"hidden",position:"relative"});
$("#kinslideshow_content").css({float:"left"});
$("#kinslideshow_contentclone").css({float:"left"});
$(kinslideshow_boxobjectselector+" #kinslideshow_movebox div").wrapall("");
$(kinslideshow_boxobjectselector+" #kinslideshow_xposbox").css({float:"left",width:"2000%"});
kinslideshow_setinterval = setinterval(function(){kinslideshow_move(settings.movestyle)},kinslideshow_intervaltime*1000+settings.movespeedtime);
};
function kinslideshow_moveright(){
$(kinslideshow_boxobjectselector+" div:lt(2)").wrapall("");
$("#kinslideshow_movebox").css({width:kinslideshow_size[0],height:kinslideshow_size[1],overflow:"hidden",position:"relative"});
$("#kinslideshow_content").css({float:"left"});
$("#kinslideshow_contentclone").css({float:"left"});
$(kinslideshow_boxobjectselector+" #kinslideshow_movebox div").wrapall("");
$(kinslideshow_boxobjectselector+" #kinslideshow_xposbox").css({float:"left",width:"2000%"});
$("#kinslideshow_contentclone").html("");
$("#kinslideshow_content a").wrap("")
$("#kinslideshow_content a").each(function(i){
$("#kinslideshow_contentclone").prepend($("#kinslideshow_content span:eq("+i+")").html());
})
$("#kinslideshow_content").html($("#kinslideshow_contentclone").html());
var kinslideshow_offsetleft = (kinslideshow_imgaelength-1)*kinslideshow_size[0];
$("#kinslideshow_movebox").scrollleft(kinslideshow_offsetleft);
kinslideshow_setinterval = setinterval(function(){kinslideshow_move(settings.movestyle)},kinslideshow_intervaltime*1000+settings.movespeedtime);
};
function kinslideshow_moveup(){
$(kinslideshow_boxobjectselector+" div:lt(2)").wrapall("");//��div����
$("#kinslideshow_movebox").css({width:kinslideshow_size[0],height:kinslideshow_size[1],overflow:"hidden",position:"relative"});
$("#kinslideshow_movebox").animate({scrolltop: 0}, 1);
kinslideshow_setinterval = setinterval(function(){kinslideshow_move(settings.movestyle)},kinslideshow_intervaltime*1000+settings.movespeedtime);
};
function kinslideshow_movedown(){
$(kinslideshow_boxobjectselector+" div:lt(2)").wrapall("");//��div����
$("#kinslideshow_movebox").css({width:kinslideshow_size[0],height:kinslideshow_size[1],overflow:"hidden",position:"relative"});
$("#kinslideshow_contentclone").html("");
$("#kinslideshow_content a").wrap("")
$("#kinslideshow_content a").each(function(i){
$("#kinslideshow_contentclone").prepend($("#kinslideshow_content span:eq("+i+")").html());
})
$("#kinslideshow_content").html($("#kinslideshow_contentclone").html());
var kinslideshow_offsettop = (kinslideshow_imgaelength-1)*kinslideshow_size[1];
$("#kinslideshow_movebox").animate({scrolltop: kinslideshow_offsettop}, 1);
kinslideshow_setinterval = setinterval(function(){kinslideshow_move(settings.movestyle)},kinslideshow_intervaltime*1000+settings.movespeedtime);
};
function kinslideshow_move(style){
switch(style){
case "left":
if(kinslideshow_changeflag >= kinslideshow_imgaelength){
kinslideshow_changeflag = 0;
$("#kinslideshow_movebox").scrollleft(0);
$("#kinslideshow_movebox").animate({scrollleft:kinslideshow_size[0]}, settings.movespeedtime);
}else{
sp =(kinslideshow_changeflag+1)*kinslideshow_size[0];
$("#kinslideshow_movebox").animate({scrollleft: sp}, settings.movespeedtime);
}
settiltfontshow(kinslideshow_changeflag+1);
break;
case "right":
var kinslideshow_offsetleft = (kinslideshow_imgaelength-1)*kinslideshow_size[0];
if(kinslideshow_changeflag >= kinslideshow_imgaelength){
kinslideshow_changeflag = 0;
$("#kinslideshow_movebox").scrollleft(kinslideshow_offsetleft+kinslideshow_size[0]);
$("#kinslideshow_movebox").animate({scrollleft:kinslideshow_offsetleft}, settings.movespeedtime);
}else{
if(kinslideshow_firstmoveflag){
kinslideshow_changeflag++;
kinslideshow_firstmoveflag = false;
}
sp =kinslideshow_offsetleft-(kinslideshow_changeflag*kinslideshow_size[0]);
$("#kinslideshow_movebox").animate({scrollleft: sp}, settings.movespeedtime);
}
settiltfontshow(kinslideshow_changeflag);
break;
case "up":
if(kinslideshow_changeflag >= kinslideshow_imgaelength){
kinslideshow_changeflag = 0;
$("#kinslideshow_movebox").scrolltop(0);
$("#kinslideshow_movebox").animate({scrolltop:kinslideshow_size[1]}, settings.movespeedtime);
}else{
sp =(kinslideshow_changeflag+1)*kinslideshow_size[1];
$("#kinslideshow_movebox").animate({scrolltop: sp}, settings.movespeedtime);
}
settiltfontshow(kinslideshow_changeflag+1);
break;
case "down":
var kinslideshow_offsetleft = (kinslideshow_imgaelength-1)*kinslideshow_size[1];
if(kinslideshow_changeflag >= kinslideshow_imgaelength){
kinslideshow_changeflag = 0;
$("#kinslideshow_movebox").scrolltop(kinslideshow_offsetleft+kinslideshow_size[1]);
$("#kinslideshow_movebox").animate({scrolltop:kinslideshow_offsetleft}, settings.movespeedtime);
}else{
if(kinslideshow_firstmoveflag){
kinslideshow_changeflag++;
kinslideshow_firstmoveflag = false;
}
sp =kinslideshow_offsetleft-(kinslideshow_changeflag*kinslideshow_size[1]);
$("#kinslideshow_movebox").animate({scrolltop: sp}, settings.movespeedtime);
}
settiltfontshow(kinslideshow_changeflag);
break;
}
kinslideshow_changeflag++;
}
function settiltfontshow(index){
if(index == kinslideshow_imgaelength){index = 0};
if(settings.ishastitlefont){
$(kinslideshow_boxobjectselector+" .kinslideshow_titlebar h2").html(kinslideshow_datearray[index]);
};
$("#btnlistid li").each(function(i){
if(i == index){
$(this).css({background:settings.btn.btn_bghovercolor,bordercolor:settings.btn.btn_borderhovercolor,color:settings.btn.btn_fonthovercolor});
}else{
$(this).css({background:settings.btn.btn_bgcolor,bordercolor:settings.btn.btn_bordercolor,color:settings.btn.btn_fontcolor});
}
})
};
function kinslideshow_btnevent(event){
switch(event){
case "mouseover" : kinslideshow_btnmouseover(); break;
case "mouseclick" : kinslideshow_btnmouseclick(); break;
default : kinslideshow_btnmouseover();
}
};
function kinslideshow_btnmouseover(){
$("#btnlistid li").mouseover(function(){
var curliindex = $("#btnlistid li").index($(this));
switch(settings.movestyle){
case "left" :
kinslideshow_changeflag = curliindex-1; break;
case "right" :
if(kinslideshow_firstmoveflag){
kinslideshow_changeflag = curliindex-1; break;
}else{
kinslideshow_changeflag = curliindex; break;
}
case "up" :
kinslideshow_changeflag = curliindex-1; break;
case "down" :
if(kinslideshow_firstmoveflag){
kinslideshow_changeflag = curliindex-1; break;
}else{
kinslideshow_changeflag = curliindex; break;
}
}
kinslideshow_move(settings.movestyle);
$("#btnlistid li").each(function(i){
if(i ==curliindex){
$(this).css({background:settings.btn.btn_bghovercolor,bordercolor:settings.btn.btn_borderhovercolor,color:settings.btn.btn_fonthovercolor});
}else{
$(this).css({background:settings.btn.btn_bgcolor,bordercolor:settings.btn.btn_bordercolor,color:settings.btn.btn_fontcolor});
}
})
})
};
function kinslideshow_btnmouseclick(){
$("#btnlistid li").click(function(){
var curliindex = $("#btnlistid li").index($(this));
switch(settings.movestyle){
case "left" :
kinslideshow_changeflag = curliindex-1; break;
case "right" :
if(kinslideshow_firstmoveflag){
kinslideshow_changeflag = curliindex-1; break;
}else{
kinslideshow_changeflag = curliindex; break;
}
case "up" :
kinslideshow_changeflag = curliindex-1; break;
case "down" :
if(kinslideshow_firstmoveflag){
kinslideshow_changeflag = curliindex-1; break;
}else{
kinslideshow_changeflag = curliindex; break;
}
}
kinslideshow_move(settings.movestyle);
$("#btnlistid li").each(function(i){
if(i ==curliindex){
$(this).css({background:settings.btn.btn_bghovercolor,bordercolor:settings.btn.btn_borderhovercolor,color:settings.btn.btn_fonthovercolor});
}else{
$(this).css({background:settings.btn.btn_bgcolor,bordercolor:settings.btn.btn_bordercolor,color:settings.btn.btn_fontcolor});
}
})
})
};
return kinslideshow_initialize();
};
//�ڶ��õ�ƭ��ʼ
$.fn.kinslideshow1 = function(settings){
settings = jquery.extend({
intervaltime : 5, //�л�չʾ���ʱ�� ����λ���롿
movespeedtime : 400,//�л�һ��ͼƭ����ʱ�䣬����λ�����롿
movestyle:"left",//�л����� �� left | right | up | down ��left:�����л�,right:�����л�,up:�����л�,down:�����л�
mouseevent:"mouseclick", //��������ť�¼�,��mouseclick | mouseover��mouseclick����굥���л���mouseover����껬���л���
ishastitlebar:true,//�ƿ���ʾ���ⱳ����
titlebar:{titlebar_height:40,titlebar_bgcolor:"#000000"},//���ⱳ����ʽ��(ishastitlebar = true ǰ��������)
ishastitlefont:true,//�ƿ���ʾ��������
titlefont:{titlefont_size:12,titlefont_color:"#ffffff",titlefont_family:"verdana",titlefont_weight:"bold"},//����������ʽ��(ishastitlefont = true ǰ��������)
ishasbtn:true, //�ƿ���ʾ��ť
btn:{btn_bgcolor:"#666666",btn_bghovercolor:"#cc0000",btn_fontcolor:"#cccccc",btn_fonthovercolor:"#000000",btn_fontfamily:"verdana",btn_bordercolor:"#999999",btn_borderhovercolor:"#ff0000",btn_borderwidth:1} //��ť��ʽ���ã�(ishasbtn = true ǰ��������)
},settings);
var titlebar_bak = {titlebar_height:40,titlebar_bgcolor:"#000000"}
var titlefont_bak = {titlefont_size:12,titlefont_color:"#ffffff",titlefont_family:"verdana",titlefont_weight:"bold"}
var btn_bak = {btn_bgcolor:"#666666",btn_bghovercolor:"#cc0000",btn_fontcolor:"#cccccc",btn_fonthovercolor:"#000000",btn_fontfamily:"verdana",btn_bordercolor:"#999999",btn_borderhovercolor:"#ff0000",btn_borderwidth:1} //��ť��ʽ���ã�(ishasbtn = true ǰ��������)
for (var key in titlebar_bak)
{
if(settings.titlebar[key] == undefined){
settings.titlebar[key] = titlebar_bak[key];
}
}
for (var key in titlefont_bak)
{
if(settings.titlefont[key] == undefined){
settings.titlefont[key] = titlefont_bak[key];
}
}
for (var key in btn_bak)
{
if(settings.btn[key] == undefined){
settings.btn[key] = btn_bak[key];
}
}
var kinslideshow1_boxobject = this;
var kinslideshow1_boxobjectselector = $(kinslideshow1_boxobject).selector;
var kinslideshow1_datearray = new array();
var kinslideshow1_imgaelength = 0;
var kinslideshow1_size =new array();
var kinslideshow1_changeflag = 0;
var kinslideshow1_intervaltime = settings.intervaltime;
var kinslideshow1_setinterval;
var kinslideshow1_firstmoveflag = true;
if(isnan(kinslideshow1_intervaltime) || kinslideshow1_intervaltime <= 1){
kinslideshow1_intervaltime = 5;
}
if(settings.movespeedtime > 500){
settings.movespeedtime = 500;
}else if(settings.movespeedtime < 100){
settings.movespeedtime = 100;
}
function kinslideshow1_initialize(){
$(kinslideshow1_boxobject).css({visibility:"hidden"});
$(kinslideshow1_boxobjectselector+" a img").css({border:0});
kinslideshow1_start();
};
function kinslideshow1_start(){
kinslideshow1_imgaelength = $(kinslideshow1_boxobjectselector+" a").length;
kinslideshow1_size.push($(kinslideshow1_boxobjectselector+" a img").width());
kinslideshow1_size.push($(kinslideshow1_boxobjectselector+" a img").height());
$(kinslideshow1_boxobjectselector+" a img").each(function(i){
kinslideshow1_datearray.push($(this).attr("alt"));
});
$(kinslideshow1_boxobjectselector+" a").wrapall("");
$("#kinslideshow1_content").clone().attr("id","kinslideshow1_contentclone").appendto(kinslideshow1_boxobject);
kinslideshow1_settitlebar();
kinslideshow1_settitlefont();
kinslideshow1_setbtn();
kinslideshow1_action();
kinslideshow1_btnevent(settings.mouseevent);
$(kinslideshow1_boxobject).css({visibility:"visible"});
};
function kinslideshow1_settitlebar(){
$(kinslideshow1_boxobject).css({width:kinslideshow1_size[0],height:kinslideshow1_size[1],overflow:"hidden",position:"relative"});
$(kinslideshow1_boxobject).append("");
var gettitlebar_height = settings.titlebar.titlebar_height;//��ȡ���߶�
if(isnan(gettitlebar_height)){
gettitlebar_height = 40;
}else if(gettitlebar_height < 25){
gettitlebar_height = 25;
};
$(kinslideshow1_boxobjectselector+" .kinslideshow1_titlebar").css({height:gettitlebar_height,width:"100%",position:"absolute",bottom:0,left:0})
if(settings.ishastitlebar){
$(kinslideshow1_boxobjectselector+" .kinslideshow1_titlebar").css({background:settings.titlebar.titlebar_bgcolor,opacity:settings.titlebar.titlebar_alpha})
}
};
function kinslideshow1_settitlefont(){
if(settings.ishastitlefont){
$(kinslideshow1_boxobjectselector+" .kinslideshow1_titlebar").append("");
$(kinslideshow1_boxobjectselector+" .kinslideshow1_titlebar .title").css({fontsize:settings.titlefont.titlefont_size,color:settings.titlefont.titlefont_color,fontfamily:settings.titlefont.titlefont_family,fontweight:settings.titlefont.titlefont_weight});
settiltfontshow(0);
};
};
function kinslideshow1_setbtn(){
if(settings.btn.btn_borderwidth > 2){settings.btn.btn_borderwidth = 2}
if(settings.btn.btn_borderwidth < 0 || isnan(settings.btn.btn_borderwidth)){settings.btn.btn_borderwidth = 0}
if(settings.ishasbtn && kinslideshow1_imgaelength >= 2){
$(kinslideshow1_boxobject).append("");
var kinslideshow1_btnlist = "";
for(i=1;i<=kinslideshow1_imgaelength;i++){
kinslideshow1_btnlist+=""+i+"";
}
kinslideshow1_btnlist = ""+kinslideshow1_btnlist+"
";
$(kinslideshow1_boxobjectselector+" .kinslideshow1_btnbox").append(kinslideshow1_btnlist);
$(kinslideshow1_boxobjectselector+" .kinslideshow1_btnbox #btnlistid1 li").css({liststyle:"none",float:"left",width:18,height:18,borderwidth:settings.btn.btn_borderwidth,bordercolor:settings.btn.btn_bordercolor,borderstyle:"solid",background:settings.btn.btn_bgcolor,textalign:"center",cursor:"pointer",marginleft:3,fontsize:12,fontfamily:settings.btn.btn_fontfamily,lineheight:"18px",opacity:settings.btn.btn_bgalpha,color:settings.btn.btn_fontcolor});
$("#btnlistid1 li:eq(0)").css({background:settings.btn.btn_bghovercolor,bordercolor:settings.btn.btn_borderhovercolor,color:settings.btn.btn_fonthovercolor});
};
};
function kinslideshow1_action(){
switch(settings.movestyle){
case "left": kinslideshow1_moveleft(); break;
case "right": kinslideshow1_moveright();break;
case "up": kinslideshow1_moveup(); break;
case "down": kinslideshow1_movedown(); break;
default: settings.movestyle = "left"; kinslideshow1_moveleft();
}
};
function kinslideshow1_moveleft(){
$(kinslideshow1_boxobjectselector+" div:lt(2)").wrapall("");
$("#kinslideshow1_movebox").css({width:kinslideshow1_size[0],height:kinslideshow1_size[1],overflow:"hidden",position:"relative"});
$("#kinslideshow1_content").css({float:"left"});
$("#kinslideshow1_contentclone").css({float:"left"});
$(kinslideshow1_boxobjectselector+" #kinslideshow1_movebox div").wrapall("");
$(kinslideshow1_boxobjectselector+" #kinslideshow1_xposbox").css({float:"left",width:"2000%"});
kinslideshow1_setinterval = setinterval(function(){kinslideshow1_move(settings.movestyle)},kinslideshow1_intervaltime*1000+settings.movespeedtime);
};
function kinslideshow1_moveright(){
$(kinslideshow1_boxobjectselector+" div:lt(2)").wrapall("");
$("#kinslideshow1_movebox").css({width:kinslideshow1_size[0],height:kinslideshow1_size[1],overflow:"hidden",position:"relative"});
$("#kinslideshow1_content").css({float:"left"});
$("#kinslideshow1_contentclone").css({float:"left"});
$(kinslideshow1_boxobjectselector+" #kinslideshow1_movebox div").wrapall("");
$(kinslideshow1_boxobjectselector+" #kinslideshow1_xposbox").css({float:"left",width:"2000%"});
$("#kinslideshow1_contentclone").html("");
$("#kinslideshow1_content a").wrap("")
$("#kinslideshow1_content a").each(function(i){
$("#kinslideshow1_contentclone").prepend($("#kinslideshow1_content span:eq("+i+")").html());
})
$("#kinslideshow1_content").html($("#kinslideshow1_contentclone").html());
var kinslideshow1_offsetleft = (kinslideshow1_imgaelength-1)*kinslideshow1_size[0];
$("#kinslideshow1_movebox").scrollleft(kinslideshow1_offsetleft);
kinslideshow1_setinterval = setinterval(function(){kinslideshow1_move(settings.movestyle)},kinslideshow1_intervaltime*1000+settings.movespeedtime);
};
function kinslideshow1_moveup(){
$(kinslideshow1_boxobjectselector+" div:lt(2)").wrapall("");//��div����
$("#kinslideshow1_movebox").css({width:kinslideshow1_size[0],height:kinslideshow1_size[1],overflow:"hidden",position:"relative"});
$("#kinslideshow1_movebox").animate({scrolltop: 0}, 1);
kinslideshow1_setinterval = setinterval(function(){kinslideshow1_move(settings.movestyle)},kinslideshow1_intervaltime*1000+settings.movespeedtime);
};
function kinslideshow1_movedown(){
$(kinslideshow1_boxobjectselector+" div:lt(2)").wrapall("");//��div����
$("#kinslideshow1_movebox").css({width:kinslideshow1_size[0],height:kinslideshow1_size[1],overflow:"hidden",position:"relative"});
$("#kinslideshow1_contentclone").html("");
$("#kinslideshow1_content a").wrap("")
$("#kinslideshow1_content a").each(function(i){
$("#kinslideshow1_contentclone").prepend($("#kinslideshow1_content span:eq("+i+")").html());
})
$("#kinslideshow1_content").html($("#kinslideshow1_contentclone").html());
var kinslideshow1_offsettop = (kinslideshow1_imgaelength-1)*kinslideshow1_size[1];
$("#kinslideshow1_movebox").animate({scrolltop: kinslideshow1_offsettop}, 1);
kinslideshow1_setinterval = setinterval(function(){kinslideshow1_move(settings.movestyle)},kinslideshow1_intervaltime*1000+settings.movespeedtime);
};
function kinslideshow1_move(style){
switch(style){
case "left":
if(kinslideshow1_changeflag >= kinslideshow1_imgaelength){
kinslideshow1_changeflag = 0;
$("#kinslideshow1_movebox").scrollleft(0);
$("#kinslideshow1_movebox").animate({scrollleft:kinslideshow1_size[0]}, settings.movespeedtime);
}else{
sp =(kinslideshow1_changeflag+1)*kinslideshow1_size[0];
$("#kinslideshow1_movebox").animate({scrollleft: sp}, settings.movespeedtime);
}
settiltfontshow(kinslideshow1_changeflag+1);
break;
case "right":
var kinslideshow1_offsetleft = (kinslideshow1_imgaelength-1)*kinslideshow1_size[0];
if(kinslideshow1_changeflag >= kinslideshow1_imgaelength){
kinslideshow1_changeflag = 0;
$("#kinslideshow1_movebox").scrollleft(kinslideshow1_offsetleft+kinslideshow1_size[0]);
$("#kinslideshow1_movebox").animate({scrollleft:kinslideshow1_offsetleft}, settings.movespeedtime);
}else{
if(kinslideshow1_firstmoveflag){
kinslideshow1_changeflag++;
kinslideshow1_firstmoveflag = false;
}
sp =kinslideshow1_offsetleft-(kinslideshow1_changeflag*kinslideshow1_size[0]);
$("#kinslideshow1_movebox").animate({scrollleft: sp}, settings.movespeedtime);
}
settiltfontshow(kinslideshow1_changeflag);
break;
case "up":
if(kinslideshow1_changeflag >= kinslideshow1_imgaelength){
kinslideshow1_changeflag = 0;
$("#kinslideshow1_movebox").scrolltop(0);
$("#kinslideshow1_movebox").animate({scrolltop:kinslideshow1_size[1]}, settings.movespeedtime);
}else{
sp =(kinslideshow1_changeflag+1)*kinslideshow1_size[1];
$("#kinslideshow1_movebox").animate({scrolltop: sp}, settings.movespeedtime);
}
settiltfontshow(kinslideshow1_changeflag+1);
break;
case "down":
var kinslideshow1_offsetleft = (kinslideshow1_imgaelength-1)*kinslideshow1_size[1];
if(kinslideshow1_changeflag >= kinslideshow1_imgaelength){
kinslideshow1_changeflag = 0;
$("#kinslideshow1_movebox").scrolltop(kinslideshow1_offsetleft+kinslideshow1_size[1]);
$("#kinslideshow1_movebox").animate({scrolltop:kinslideshow1_offsetleft}, settings.movespeedtime);
}else{
if(kinslideshow1_firstmoveflag){
kinslideshow1_changeflag++;
kinslideshow1_firstmoveflag = false;
}
sp =kinslideshow1_offsetleft-(kinslideshow1_changeflag*kinslideshow1_size[1]);
$("#kinslideshow1_movebox").animate({scrolltop: sp}, settings.movespeedtime);
}
settiltfontshow(kinslideshow1_changeflag);
break;
}
kinslideshow1_changeflag++;
}
function settiltfontshow(index){
if(index == kinslideshow1_imgaelength){index = 0};
if(settings.ishastitlefont){
$(kinslideshow1_boxobjectselector+" .kinslideshow1_titlebar h2").html(kinslideshow1_datearray[index]);
};
$("#btnlistid1 li").each(function(i){
if(i == index){
$(this).css({background:settings.btn.btn_bghovercolor,bordercolor:settings.btn.btn_borderhovercolor,color:settings.btn.btn_fonthovercolor});
}else{
$(this).css({background:settings.btn.btn_bgcolor,bordercolor:settings.btn.btn_bordercolor,color:settings.btn.btn_fontcolor});
}
})
};
function kinslideshow1_btnevent(event){
switch(event){
case "mouseover" : kinslideshow1_btnmouseover(); break;
case "mouseclick" : kinslideshow1_btnmouseclick(); break;
default : kinslideshow1_btnmouseover();
}
};
function kinslideshow1_btnmouseover(){
$("#btnlistid1 li").mouseover(function(){
var curliindex = $("#btnlistid1 li").index($(this));
switch(settings.movestyle){
case "left" :
kinslideshow1_changeflag = curliindex-1; break;
case "right" :
if(kinslideshow1_firstmoveflag){
kinslideshow1_changeflag = curliindex-1; break;
}else{
kinslideshow1_changeflag = curliindex; break;
}
case "up" :
kinslideshow1_changeflag = curliindex-1; break;
case "down" :
if(kinslideshow1_firstmoveflag){
kinslideshow1_changeflag = curliindex-1; break;
}else{
kinslideshow1_changeflag = curliindex; break;
}
}
kinslideshow1_move(settings.movestyle);
$("#btnlistid1 li").each(function(i){
if(i ==curliindex){
$(this).css({background:settings.btn.btn_bghovercolor,bordercolor:settings.btn.btn_borderhovercolor,color:settings.btn.btn_fonthovercolor});
}else{
$(this).css({background:settings.btn.btn_bgcolor,bordercolor:settings.btn.btn_bordercolor,color:settings.btn.btn_fontcolor});
}
})
})
};
function kinslideshow1_btnmouseclick(){
$("#btnlistid1 li").click(function(){
var curliindex = $("#btnlistid1 li").index($(this));
switch(settings.movestyle){
case "left" :
kinslideshow1_changeflag = curliindex-1; break;
case "right" :
if(kinslideshow1_firstmoveflag){
kinslideshow1_changeflag = curliindex-1; break;
}else{
kinslideshow1_changeflag = curliindex; break;
}
case "up" :
kinslideshow1_changeflag = curliindex-1; break;
case "down" :
if(kinslideshow1_firstmoveflag){
kinslideshow1_changeflag = curliindex-1; break;
}else{
kinslideshow1_changeflag = curliindex; break;
}
}
kinslideshow1_move(settings.movestyle);
$("#btnlistid1 li").each(function(i){
if(i ==curliindex){
$(this).css({background:settings.btn.btn_bghovercolor,bordercolor:settings.btn.btn_borderhovercolor,color:settings.btn.btn_fonthovercolor});
}else{
$(this).css({background:settings.btn.btn_bgcolor,bordercolor:settings.btn.btn_bordercolor,color:settings.btn.btn_fontcolor});
}
})
})
};
return kinslideshow1_initialize();
};
})(jquery);