This article is an example of the use of JS to achieve simple mobile phone-side floating window display effect. Share to everyone for your reference, specific as follows:
Html:
<style type= "Text/css" > fdbontel{width:100%; height:53px; position:fixed: #0052ae; background: Center left:0; bottom:0; z-index:999; }. fdonline{Background:url (index/images/online.png) no-repeat; width:255px; height:181px; position:fixed; left:50%; margin-left:-128px; top:40%; z-index:999; border-radius:15px;
box-shadow:0 0 20px Rgba (10, 2, 4, 0.75);} . fdonline. fdoclose{width:44px; height:44px; display:block; margin-top:-17px margin-right:-6px; fdOnline Background: #CF3; width:127px; height:58px; Display:block;
margin-top:123px;} . fdonline. fdoon{background: #036; width:128px; height:58px; display:block; margin-top:96px; <div class= "Fdbontel" > <map name= "Maps" id= "Maps" > ; area shape= "rect" coords= "2,2,79,52" onclick= "Openzoosurl ();" > <area shape= "rect" coords= "77,2,166,52" href= "tel:0855-8253310" > <area shape= "rect" coords= "166, 4,242, Wuyi "onclick=" Openzoosurl (); > <area shape= "rect" coords= "248,5,318,53" onclick= "Openzoosurl" (); " > </map> </div> <div class= "Fdonline" id= "Fdonline" > <a href= "###" class= "Fdoclose f_r" onclic K= "Closeonline ();" ></a> <a href= "###" class= "Fdotel f_l" &
gt;</a> <a href= "###" class= "Fdoon f_r" ></a> </div>
JS:
JavaScript Document Document.writeln ("<style type=\" text/css\ ">"); Document.writeln (". fdbontel{width:100%; height:53px; position:fixed; Background: #0052ae; Text-align:center; left:0; bottom:0; z-index:999;
}"); Document.writeln (". fdonline{background:url (index/images/online.png) no-repeat; width:255px; height:181px; position:fixed; left:50%; margin-left:-128px; top:40%; z-index:999; border-radius:15px;
box-shadow:0 0 20px Rgba (10, 2, 4, 0.75);} "); Document.writeln (". Fdonline. fdoclose{width:44px; height:44px; Display:block; margin-top:-17px;
margin-right:-6px;} "); Document.writeln (". Fdonline. fdotel{width:127px; height:58px; Display:block;
margin-top:123px;} "); Document.writeln (". Fdonline. fdoon{width:128px; height:58px; Display:block;
margin-top:96px;} ");
Document.writeln ("</style>");
Document.writeln ("<div class=\" fdbontel\ ">");
Document.writeln ("</a>");
Document.writeln ("<a href=\" ###\ "class=\" Fdotel f_l\ "></a>");
Document.writeln ("<a href=\" ###\ "class=\" Fdoon f_r\ "></a>");
Document.writeln ("</div>"); function Showonline () {if (document.getElementById ("Fdonline")) {if(document.getElementById ("Fdonline"). Style.display = = "None")
{document.getElementById ("Fdonline"). Style.display = "block";
}} function Closeonline () {document.getElementById ("Fdonline"). Style.display = "None";
SetInterval (CHKSWT, 30000);
};
$ (function () {setinterval (showonline, 30000);});
Effect Chart:
More readers interested in JavaScript-related content can view the site topics: "JavaScript traversal algorithm and tips summary", "JavaScript switching effects and techniques summary", "JavaScript Search Algorithm Skills summary", " JavaScript animation effects and tips Summary, "JavaScript Error and debugging skills Summary", "JavaScript data structure and algorithm skills summary" and "JavaScript Mathematical Computing Usage Summary"
I hope this article will help you with JavaScript programming.