Non-flash image Switching Effect

Source: Internet
Author: User

 

<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<Html xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>
<Title> untitled document </title>
<Script language = "javascript" type = "text/javascript">
<! --
Function p $ (string ){
Document. write (string );
}
Function $ (id ){
Return document. getElementById (id );
}
Function change_menu (id, content_id, num, total_ztc_menu, menu_on, menu_off ){
For (var I = 1; I <= total_ztc_menu; I ++ ){
$ (Id + I). className = menu_off;
$ (Content_id + I). style. display = 'none ';
}
$ (Id + num). className = menu_on;
$ (Content_id + num). style. display = 'block ';
}
-->
</Script>

</Head>
<Body>
<Div id = "flashMan">
<! -- ===================================================== ========================================================== ======= Ad start ===-->
<Div class = "content">
<Div id = "t_l">
<Div id = "ad_pic">
<Div id = "f_div">
<! -- Image region -->
<Div id = "f_imgDiv"> <a id = "f_imgLink"> </a> </div>
<Div id = "f_infoDiv">
<! -- Digit button area -->
<Div id = "f_buttonDiv">
<Div id = "div_bg3" class = "bg"> <a id = "b3" href = "javascript: B _change (3)"> 4 </a> </div>
<Div/>
<Div id = "div_bg2" class = "bg"> <a id = "b2" title = "tu" href = "javascript: B _change (2) "> 3 </a> </div>
<Div/>
<Div id = "div_bg1" class = "bg"> <a id = "b1" href = "javascript: B _change (1)"> 2 </a> </div>
<Div/>
<Div id = "div_bg0" class = "bg"> <a id = "b0" href = "javascript: B _change (0)"> 1 </a> </div>
<Div/>
</Div>
</Div>
</Div>
<Div id = "f_text" class = "f12b"> <a target = "_ blank" href = "http://changxiao.17k.com/topic/1/index.shtml"> Dongfang Shuo </a> </div>
<Div class = "clear"> </div>
</Div>
</Div>
</Div>
<Script type = "text/javascript">
<! --
// Modifiable Region
Var imgWidth = 290;
Var imgHeight = 250;
Var _ timeOut _ = 5000;
Var show_text = true; // whether to display the focus text
Var timeOut = _ timeOut _;
Var timeOut2 = _ timeOut _/2; // time to switch after onmouseout img
Var nowpic = 0; // the first figure
Var target = "_ blank"; // Open Mode
Var button_on = 'on'; // The style name of the button corresponding to the current focus
Var button_off = ''; // The style name of the button corresponding to the non-current focus

// Unchangeable 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 with the browser version; default value: 2: Non-ie
Var firstTime = true;
Var n =-1;

// Menu
MenuList [++ n] = 'xx ';
ImgUrl [n] = 'HTTP: // img.17k.com/channel/changxiao/dongfang290x250.gif ';
ImgText [n] = '<a href = http://changxiao.17k.com/topic/1/index.shtml target = _ blank> Dongfang Shuo </a> ';
ImgLink [n] = 'HTTP: // changxiao.17k.com/topic/1/index.shtml ';
ImgAlt [n] = 'dongfang Shuo ';

// Menu
MenuList [++ n] = 'xx ';
ImgUrl [n] = 'HTTP: // img.17k.com/channel/ebook/3170601.jpg ';
ImgText [n] = '<a href =/main/readbook. do? Method = showCatalogue & bid = 31706 target = _ blank> reborn Wu yingxiong </a> ';
ImgLink [n] = '/main/readbook. do? Method = showCatalogue & bid = 31706 ';
ImgAlt [n] = 'reborn Wu yingxiong ';

// Menu
MenuList [++ n] = 'xx ';
ImgUrl [n] = 'HTTP: // img.17k.com/channel/ebook/3172702.jpg ';
ImgText [n] = '<a href =/main/readbook. do? Method = showCatalogue & bid = 31727 target = _ blank> East China Sea tu </a> ';
ImgLink [n] = '/main/readbook. do? Method = showCatalogue & bid = 31727 ';
ImgAlt [n] = 'East China tu ';

// Menu
MenuList [++ n] = 'xx ';
ImgUrl [n] = 'HTTP: // img.17k.com/channel/shouye/20080314/2654203.jpg ';
ImgText [n] = '<a href =/main/readbook. do? Method = showCatalogue & bid = 26542 target = _ blank> bikong </a> ';
ImgLink [n] = '/main/readbook. do? Method = showCatalogue & bid = 26542 ';
ImgAlt [n] = 'qianlong Start ';

Var count = 0;
For (var I = 0; I If (imgUrl [I]! = "") & (ImgText [I]! = "") & (ImgLink [I]! = "") & (ImgAlt [I]! = "")){
Count ++;
} Else {
Break;
}
}
// Rewrite css
Var each_width = Math. ceil (imgWidth-(count-1)/count );
Var last_width = imgWidth-each_width * (count-1)-(count) + 1;

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 [nowpic];
$ ('F _ img '). alt = imgAlt [nowpic];
$ ('F _ imgLink '). href = imgLink [nowpic];
If (show_text) $ ('f _ text'). innerHTML = imgText [nowpic];
For (var I = 0; I <count; I ++ ){
$ ('B' + I). className = "button ";
// $ ('F _ menu '+ I). className = "";
}
$ ('B' + nowpic). className = "on ";
// $ ('F _ menu '+ nowpic). className = "on ";
Nowpic = (nowpic> = imgUrl. length-1 )? 0: nowpic + 1;
TimeOut = _ timeOut _;
}
TheTimer = setTimeout ("change ()", timeOut );
}
Function B _change (num ){
Window. clearInterval (theTimer );
Nowpic = num;
FirstTime = false;
Change ();
}
// Draw gradient line (css: f_line)
Function draw_line (){
Var div = document. createElement ("div ");
Div. id = 'f _ line ';
$ ('F _ infoDiv '). insertBefore (div, $ ('f _ infoDiv'). childNodes. item (0 ));
}
// Start of the Presentation Layer
// Image
Var a = document. createElement ("");
A. id = "f_imgLink ";
A.tar get = target;
A. href = imgLink [nowpic];
$ ('F _ imgDiv '). appendChild ();

Var img = document. createElement ("img ");
Img. id = "f_img ";
Img. width = imgWidth;
Img. height = imgHeight;
Img. src = imgUrl [nowpic];
Img. alt = imgAlt [nowpic];
A. appendChild (img );

// Numeric 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. id = 'B' + I;
A. className = (I = nowpic + 1 )? "Button_on": "button_off ";
A. title = imgAlt [I];
A. innerHTML = I + 1;
A. href = 'javascript: B _change ('+ I + ')';
$ ('Div _ bg '+ I). appendChild ();
Var div = document. createElement ("div ");
$ ('F _ buttonDiv '). appendChild (div );
}
If (show_text) $ ('f _ text'). innerHTML = imgText [nowpic];
// Presentation 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>
<! -- ===================================================== ========================================================== ======= Ad end ===-->
</Div>

</Body>
</Html>

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.