PHP + JavaScript LCD Clock

zhaozj2021-02-08  216

Author: caocao Issue Date: December 20, 2000 Hits:? 126 <$ size_small = 5; // LCD width $ size_big = 25; // LCD length $ distance = 10; // spacing $ color_back = "# DDDDDD "; $ Color_dark =" # cccccc "; $ color_light =" # 000000 "; $ number = 0;?> timer </ title> <meta http-equiv =" content-type " CHARSET = GB2312> <script language = "javascript"> // ************************************ ******************************************************* // Written by caocao // caoca @eastday.com / / Http://caocao.oso.com.cn // ******************************************* ***************************** FUNCTION SWAPCOLOR (OBJ, ONOFF) / / change color {if (onoff) {Obj.Style. Background = "<? echo $ color_light;?>";} else {obj.style.background = "<? echo $ color_DARK;?>";}} function change (number, timer) // processing digital display {switch ( Timer) {CASE 0: SwapColor (EVAL ("Time" Number "0"), 1); SwapColor (Eval ("Time" Number "1), 1); SwapColor (Eval (" Time " Number " 2 "), 1); SwapColor (EV Al ("Time" Number "3"), 0); SWAPCOLOR (EVAL ("Time" Number "4"), 1); SwapColor (Eval ("Time" Number "5"), 1); SWAPColor (EVAL ("Time" Number "6"), 1); Break; Case 1: SwapColor (EVAL ("Time" Number "0), 0); SwapColor (EVAL (" Time " Number " 1 " ), 0); SWAPCOLOR (EVAL ("Time" Number "2"), 1);</p> <p>SwapColor (EVAL ("Time" Number "3"), 0); SwapColor (Eval ("Time" Number "4"), 0); SwapColor (EVAL ("Time" Number "5"), 1) SwapColor (EVAL ("Time" Number "6"), 0); Break; Case 2: SwapColor (EVAL ("Time" Number "0"), 1); SWAPCOLOR (EVAL ("Time" Number " 1 "), 0); SWAPCOLOR (EVAL (" Time " Number " 2 "), 1); SwapColor (EVAL (" Time " Number " 3 "), 1); SWAPCOLOR (Eval Number "4"), 1); SWAPCOLOR (EVAL ("Time" Number "5"), 0); SWAPCOLOR (EVAL ("Time" Number "6"), 1); Break; Case 3: Swapcolor (Eval ("Time" Number "0"), 1); SwapColor (EVAL ("Time" Number "1"), 0); SwapColor (EVAL ("Time" Number "2"), 1); SWAPCOLOR EVAL ("Time" Number "3"), 1); SwapColor (EVAL ("Time" Number "4"), 0); SwapColor (EVAL ("Time" Number "5"), 1); SwapColor (EVAL ("Time" Number "6"), 1); Break; Case 4: SwapColor (EVAL ("Time" Number "0), 0); SwapColor (EVAL (" Time " Number " 1 " ), 1); SwapColor (EVAL ("Time" Number "2"), 1); s WAPCOLOR (EVAL ("Time" Number "3"), 1); SWAPCOLOR (EVAL ("Time" Number "4"), 0); SwapColor (EVAL ("Time" Number "5"), 1) SwapColor (EVAL ("Time" </p> <p>Number "6"), 0); Break; Case 5: SwapColor ("Time" Number "0"), 1); SWAPCOLOR (EVAL ("Time" Number "1), 1); SWAPCOLOR EVAL ("Time" Number "2"), 0); SwapColor (EVAL ("Time" Number "3"), 1); SWAPCOLOR (EVAL ("Time" Number "4"), 0); SWAPColor (EVAL ("Time" Number "5"), 1); SwapColor (EVAL ("Time" Number "6"), 1); Break; Case 6: SwapColor (Eval " Number " 0 " ), 1); SWAPCOLOR (EVAL ("Time" Number "1); SwapColor (EVAL (" Time " Number " 2 "), 0); SwapColor (Eval (" Time " Number " 3 "), 1); SwapColor (EVAL (" Time " Number " 4 "), 1); SwapColor (EVAL (" Time " Number " 5 "), 1); SwapColor (Eval (" Time " Number " 6 "), 1); Break; Case 7: Swapcolor (Eval (" Time " Number " 0 "), 1); SwapColor (Eval Number " 1 "), 0); SwapColor (EVAL "Time" Number "2"), 1); SwapColor (EVAL ("Time" Number "3"), 0); SwapColor (EVAL ("Time" Number "4"), 0); SwapColor (Eval ("Time" Number "5"), 1); SWAPCOLOR (EVAL ("Time" N Umber "6"), 0); Break; Case 8: SwapColor (EVAL ("Time" Number "0"), 1); SWAPCOLOR (EVAL ("Time" Number "1), 1); SwapColor EVAL ("Time" Number "</p> <p>2 "), 1); SWAPCOLOR (EVAL (" Time " Number " 3 "), 1); SwapColor (EVAL (" Time " Number " 4 "), 1); SWAPCOLOR (EVAL (" Time " Number "5"), 1); SWAPCOLOR (EVAL ("Time" Number "6"), 1); Break; Case 9: SwapColor ("Time" Number "0"), 1); SWAPCOLOR (EVAL ("TIME" Number "1), 1); SwapColor (EVAL (" Time " Number " 2 "), 1); SwapColor (Eval (" Time " Number " 3 "), 1); SwapColor EVAL ("Time" Number "4"), 0); SwapColor (EVAL ("Time" Number "5"), 1); SWAPCOLOR (EVAL ("Time" Number "6"), 1); BREAK }} Function show () // Update time {var now = new date (); change (0, math.fllor (now.GETHOURS () / 10)); Change (1, Math.Floor (now.Gethours )% 10)); Change (2, Math.Floor (now.getminutes () / 10)); Change (3, Math.Floor (now.getminutes ()% 10)); Change (4, Math.Fllor Now.getSeconds () / 10)); Change (5, Math.Floor (now.getSeconds ()% 10)); SetTimeout ("Show ()", 200);} </ script> </ head> <? Echo "<body bgcolor =". $ color_back. ">; echo" <table width = ". ($ size_small * 3 $ size_big $ distance) * 6). "Border = 0 cellspacing = 0 cellpadding = 0> <tr>"; for ($ NUNBER = 0; $ Number <6; $ Number ) {$ Recid = 0; Echo "<TD> <Table Width =" ($ size_small * 2 $ size_big). "Border = 0 cellspacing = 0 cellpadding = 0> <tr>"; echo "<td width =" $ size_small. "Height =". $ size_small. "> <</p> <p>/ TD> "; Echo" <TD width = ". $ size_big." HEIGHT = "."> <div id = time ". $ Number. $ Recid ." style = "Position: relative; width:" . $ size_big. "$ size_small." px; background: ". $ color_dark."; font-size: 1px "> </ div> </ td>"; echo "<td width =" $ size_small. "hT =". "> </ td>"; echo "<TD width =". $ size_small. "HEIGHT =". $ size_big. "> <div id = Time". $ Number. $ Recid . "style =" Position: relative; width: ". $ size_small." PX; Height: ". $ size_big." PX; background: ". $ color_dark. "; Font-size: 1px"> </ div> </ td> "; echo" <td width = ". $ Size_big." Height = ". $ Size_big."> </ Td> "; echo <TD Width = "$ size_small. $ size_big."> <div id = time ". $ Number. $ Recid ." style = "POSITION: Relative; Width:". $ size_small. "PX; Height: "$ size_big." PX; background: ". $ color_dark."; font-size: 1px "> </ div> </ td>"; echo "<Tr> <tr>"; echo "<TD Width = "$ size_small." HEIGHT = ". $ size_small."> </ td> "; echo" <td width = ". $ size_big." Height = ". $ size_small."> <div id = time ". $ Number. $ RECID . "Style =" POSITION: Relative; Width: ". $ Size_big." PX; Height: "$ size_small." PX; Background: ". $ Color_dark."; Font-size: 1px "> </ div> <</p> <p>/ TD> "; echo" <td width = ". $ size_small." HEIGHT = ". $ size_small."> </ td> "; echo" </ TD "<tr>"; echo "<td width =" $ size_small. $ size_big. "> <div id = time". $ Number. $ Recid . "style =" Position: relative; width: ". $ size_small." PX; Height: ". Size_big. "PX; Background:". $ color_dark. "; font-size: 1px"> </ div> </ td> "; echo" <td width = ". $ size_big." HEIGHT = ". $ size_big. "> </ td>"; echo "<td width =" $ size_small. "Height =". $ size_big. "> <div id = time". $ Number. $ Recid . "style =" POSITION: Relative; Width: "$ size_small." PX; Height: ". $ size_big." PX; Background: ". $ color_dark."; font-size: 1px "> </ div> </ td>"; echo </ Tr> <Tr> "; Echo" <TD Width = ". $ size_small." Height = ". $ size_small."> </ td> "; echo" <td width = ". $ size_big." HEIGHT = ". $ SIZE_SMALL. "> <div id = time". $ Number. $ Recid . "style =" POSITION: Relative; Width: "$ size_big." PX; Height: ". $ size_small." px; background: ". $ color_dark. "; font-size: 1px"> </ div> </ td> "; echo" <td width = ". $ size_small." HEIGHT = ". $ size_small."> </ td> "; echo "</ tr> </ ta BLE> </ TD> "; IF ($ Number == 1 || $ Number == 3) {Echo" <TD> <Table Width = ". ($ size_small * 3)." Border =</p> <p>0 cellspacing = 0 cellpadding = 0> <tr> "; echo" <td width = ". $ Size_small." Height = ". $ Size_small."> </ Td> "; echo" <td width = ". $ Size_small "Height =" $ size_small. "> </ Td>"; echo "<td width =". $ Size_small. "Height =". $ Size_small. "> </ Td>"; echo "</ TR> <tr> "; echo" <td width = "$ size_small." Height = ". $ size_big."> </ td> "; echo" <td width = ". $ size_small." HEIGHT = ". $ size_big "<div sty =" POSITION: Relative; Width: "$ size_small." $ size_small. "PX; Background:". $ color_light. "; font-size: 1px"> </ Div> </ td> "; echo" <td width = "$ size_small." Height = ". $ size_big."> </ td> "; echo" </ TR> <TR> "; ECHO <TD Width = ". $ size_small." HEIGHT = ". $ size_small."> </ td> "; echo" <td width = ". $ size_small." HEIGHT = ". $ size_small."> </ td> "; Echo "<td width =". $ size_small. "HEIGHT =". $ size_small. "> </ td>"; echo "<TD Width ="; $ size_small. " = "$ size_big."> </ td> "; echo" <td width = ". $ size_small." HEIGHT = ". $ size_big."> <div style = "Positi ON: Relative; Width: "$ size_small." PX; Height: "$ size_small." PX; Background: "; font-size: 1px"</p> <p>> </ div> </ td> "; echo" <td width = ". $ size_small." Height = ". $ size_big."> </ td> "; echo" </ TR> <TR> "; ECHO "<td width =" $ size_small. "Height =". $ size_small. "> </ td>"; echo "<td width =". $ size_small. "HEIGHT =". $ size_small. "> </ td > "; Echo" <td width = ". $ Size_small." HEIGHT = ". $ Size_small."> </ Td> "; echo" </ tr> </ table> </ td> ";}} echo" </ tr> </ table> ";?> <script language =" javascript "> show (); </ script> </ body> </ html> [this article copyright belongs to Ozo network, if required Reprinted, please indicate the author and the source]</p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-2943.html</div><div class="plugin d-flex justify-content-center mt-3"></div><hr><div class="row"><div class="col-lg-12 text-muted mt-2"><i class="icon-tags mr-2"></i><span class="badge border border-secondary mr-2"><h2 class="h6 mb-0 small"><a class="text-secondary" href="tag-2.html">9cbs</a></h2></span></div></div></div></div><div class="card card-postlist border-white shadow"><div class="card-body"><div class="card-title"><div class="d-flex justify-content-between"><div><b>New Post</b>(<span class="posts">0</span>) </div><div></div></div></div><ul class="postlist list-unstyled"> </ul></div></div><div class="d-none threadlist"><input type="checkbox" name="modtid" value="2943" checked /></div></div></div></div></div><footer class="text-muted small bg-dark py-4 mt-3" id="footer"><div class="container"><div class="row"><div class="col">CopyRight © 2020 All Rights Reserved </div><div class="col text-right">Processed: <b>0.045</b>, SQL: <b>9</b></div></div></div></footer><script src="./lang/en-us/lang.js?2.2.0"></script><script src="view/js/jquery.min.js?2.2.0"></script><script src="view/js/popper.min.js?2.2.0"></script><script src="view/js/bootstrap.min.js?2.2.0"></script><script src="view/js/xiuno.js?2.2.0"></script><script src="view/js/bootstrap-plugin.js?2.2.0"></script><script src="view/js/async.min.js?2.2.0"></script><script src="view/js/form.js?2.2.0"></script><script> var debug = DEBUG = 0; var url_rewrite_on = 1; var url_path = './'; var forumarr = {"1":"Tech"}; var fid = 1; var uid = 0; var gid = 0; xn.options.water_image_url = 'view/img/water-small.png'; </script><script src="view/js/wellcms.js?2.2.0"></script><a class="scroll-to-top rounded" href="javascript:void(0);"><i class="icon-angle-up"></i></a><a class="scroll-to-bottom rounded" href="javascript:void(0);" style="display: inline;"><i class="icon-angle-down"></i></a></body></html><script> var forum_url = 'list-1.html'; var safe_token = 'k_2FsjzwM_2FWOU0VP24TtkYIKsyz2_2FFqLNT_2FaJilxWjtF4o0m4Cl_2B4gYFHGF47SPo51x6EnJz4xWGDL8V_2FPLn8_2F6A_3D_3D'; var body = $('body'); body.on('submit', '#form', function() { var jthis = $(this); var jsubmit = jthis.find('#submit'); jthis.reset(); jsubmit.button('loading'); var postdata = jthis.serializeObject(); $.xpost(jthis.attr('action'), postdata, function(code, message) { if(code == 0) { location.reload(); } else { $.alert(message); jsubmit.button('reset'); } }); return false; }); function resize_image() { var jmessagelist = $('div.message'); var first_width = jmessagelist.width(); jmessagelist.each(function() { var jdiv = $(this); var maxwidth = jdiv.attr('isfirst') ? first_width : jdiv.width(); var jmessage_width = Math.min(jdiv.width(), maxwidth); jdiv.find('img, embed, iframe, video').each(function() { var jimg = $(this); var img_width = this.org_width; var img_height = this.org_height; if(!img_width) { var img_width = jimg.attr('width'); var img_height = jimg.attr('height'); this.org_width = img_width; this.org_height = img_height; } if(img_width > jmessage_width) { if(this.tagName == 'IMG') { jimg.width(jmessage_width); jimg.css('height', 'auto'); jimg.css('cursor', 'pointer'); jimg.on('click', function() { }); } else { jimg.width(jmessage_width); var height = (img_height / img_width) * jimg.width(); jimg.height(height); } } }); }); } function resize_table() { $('div.message').each(function() { var jdiv = $(this); jdiv.find('table').addClass('table').wrap('<div class="table-responsive"></div>'); }); } $(function() { resize_image(); resize_table(); $(window).on('resize', resize_image); }); var jmessage = $('#message'); jmessage.on('focus', function() {if(jmessage.t) { clearTimeout(jmessage.t); jmessage.t = null; } jmessage.css('height', '6rem'); }); jmessage.on('blur', function() {jmessage.t = setTimeout(function() { jmessage.css('height', '2.5rem');}, 1000); }); $('#nav li[data-active="fid-1"]').addClass('active'); </script>