<div id= "F_div" >
<!--picture area-->
<div id= "F_imgdiv" ></div>
<div id= "F_infodiv" >
<!--digital button area-->
<div id= "F_buttondiv" ></div>
</div>
</div>
<script>
var imgwidth=250;
var imgheight=205;
var _timeout_=5000;
var show_text = true; Whether to display focus text
var timeout=_timeout_;
The time to switch after Var timeout2=_timeout_/2;//onmouseout img
var now=0; First picture
var target= "_blank"; Open mode
var button_on = ' on '; The style name of the current focus corresponding button
var button_off = ';//non-current focus button's style name
Cannot modify region
var imgurl = new Array ();
var imgtext = new Array ();
var imglink = new Array ();
var imgalt= new Array ();
var menulist = new Array ()//Menu
var ver=2; Compatible browser version default 2 is not IE
var firsttime=true;
var n =-1;
[Loop=5]
Imgurl[++n]= ' {$Field (picurl,text,0,..., 0,)} ';
Imgtext[n]= ' <a href= {$Field (id,getinfourl,1,1)} ' target= _blank ' class=linkblack>{$Field (title,text,0,..., 0,)}</a> ';
Imglink[n]= ' {$Field (id,getinfourl,1,1)} ';
Imgalt[n]= ' {$Field (title,text,0,..., 0,)} ';
[/loop]
var count=0;
for (i=0;iif ((imgurl[i]!= "") && (imgtext[i]!= "") && (imglink[i]!= "") && (imgalt[i]!= "")) {
count++;
} else {
Break
}
}
function p$ (string) {
document.write (string);
}
function $ (ID) {
return document.getElementById (ID);
}
Fixed picture size
p$ ("<style> #f_img {width:" +imgwidth+ "Px;height:" +imgheight+ "px;</style>");
function Change () {
if (ver==1) {
With ($ (' f_img '). Filters[0]) {
Transition=1;
Apply ();
Play ();
}
}
if (firsttime) {firsttime=false;timeout=_timeout_/1000;}
else{
$ (' f_img '). Src=imgurl[now];
$ (' f_img '). Alt=imgalt[now];
$ (' F_imglink '). Href=imglink[now];
for (Var i=0;i<count;i++) {
$ (' B ' +i). classname= "button";
$ (' F_menu ' +i). classname= "";
}
$ (' B ' +now). Classname= "on";
$ (' F_menu ' +now). Classname= "on";
now= (now>=imgurl.length-1) 0:now+1;
Timeout=_timeout_;
}
Thetimer=settimeout ("Change ()", timeOut);
}
function B_change (num) {
Window.clearinterval (Thetimer);
Now=num;
Firsttime=false;
Change ();
}
Draw gradient line (ie css:f_line)
function Draw_line () {
var div = document.createelement ("div");
div.id = ' f_line ';
$ (' F_infodiv '). InsertBefore (div,$ (' F_infodiv '). Childnodes.item (0));
}
Performance Layer Start
Image
var a = document.createelement ("a");
A.id= "F_imglink";
A.target=target;
A.href=imglink[now];
$ (' F_imgdiv '). appendchild (a);
var img = document.createelement ("img");
Img.id= "F_img";
Img.width=imgwidth;
Img.height=imgheight;
Img.src=imgurl[now];
Img.alt=imgalt[now];
A.appendchild (IMG);
Number button
for (Var i=count-1;i>=0;i--) {
var div_bg = document.createelement ("div");
div_bg.id = ' DIV_BG ' +i;
Div_bg.classname= ' BG ';
$ (' F_buttondiv '). appendchild (DIV_BG);
var a = document.createelement ("a");
a.ID = ' B ' +i;
A.classname = (i==now+1)? " Button_on ":" Button_off ";
A.title=imgalt[i];
a.innerhtml=i+1;
A.href= ' Javascript:b_change (' +i+ ') ';
$ (' DIV_BG ' +i). appendchild (a);
var div= document.createelement ("div");
$ (' F_buttondiv '). appendchild (Div);
}
Performance Layer End
$ (' f_img '). Onmouseover=function () {window.clearinterval (thetimer);}
$ (' f_img '). Onmouseout=function () {thetimer=settimeout ("Change ()", TimeOut2);}
try{//Filter version
New ActiveXObject ("DXImageTransform.Microsoft.Fade");
$ (' f_img '). Filters[0].play ();
Ver=1;
Draw_line ();
}
catch (e) {ver=2;}
var Thetimer = settimeout ("Change ()", _timeout_/1000);
</script>
Don't forget the SQL query statement:
--------------------------------------------------------------------------------
Select Top 5 id,title,adddate,picurl,slide,verific from ks_article where verific=1 and slide=1 the ORDER by adddate desc---- ----------------------------------------------------------------------------
If you're not going to do it or can't do it or read the code, please let me know and I'll send the video.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.