Simulate the progress bar of Windows Control

zhaozj2021-02-16  50

xyprogresslg xo </ title> <script> function xyprogresslg (xyi) {this.xyprogressid = 'oprogress' math.random (). Tostring (). Substr (2, 10) xyi ;</p> <p>this.max = 0; this.min = 0; this.width = 100; this.height = 20; this.currpos = 0; this.outerbordercolor = "black"; this.outerbackColor = "white"; this.innerbordercolor = ""; This.innerbackcolor = "blue"; this.TextColor = "red";</p> <p>this.SetProgressTop = xySetProgressTop; this.SetProgressLeft = xySetProgressLeft; this.SetProgressWidth = xySetProgressWidth; this.SetProgressHeight = xySetProgressHeight; this.SetProgressBorderColor = xySetProgressBorderColor; this.SetProgressForeBorderColor = xySetProgressForeBorderColor; this.SetProgressBackColor = xySetProgressBackColor; this.SetProgressForeColor = xySetProgressForeColor; this. EnableProgressText = xyEnableProgressText; this.SetProgressTextFontSize = xySetProgressTextFontSize; this.SetProgressTextFontColor = xySetProgressTextFontColor; this.SetProgressTextFontFamily = xySetProgressTextFontFamily;</p> <p>this.SetProgressMax = xySetProgressMax; this.SetProgressMin = xySetProgressMin; this.UpdatePosition = xyUpdatePosition; this.UpdateToPosition = xyUpdateToPosition; this.UpdatePersent = xyUpdatePersent; this.UpdateToPersent = xyUpdateToPersent;</p> <p>xyProgressInit (this.xyProgressID); return this.xyProgressID;} function xyProgressInit (xyID) {var div = document.createElement ( "div"); div.id = xyID; div.style.position = "absolute"; div.style .left = "100px"; div.style.top = "100px"; Document.body.Appendchild (div); var pro = document.createElement ("div"); Pro.Style.Position = "absolute"; pro. Style.style.top = "0px"; Pro.Style.FontSize = "0px"; Pro.Style.Width = "100PX"; Pro.Style.Height = "20px"; Pro. Style.Border = "1px solid black"; Pro.Style.Background = "white"; Pro.Style.zindex = "100"; Div.AppendChild (Pro);</p> <p>VAR proinner = document.createElement ("div"); procner.id = XYID "_ inner"; procner.style.position = "absolute"; procner.style.Left = "1px"; procner.style.top = "1px" Procner.style.fontsize = "0px"; procner.style.width = "0px"; procner.style.Height = "16px"; procner.style.Border = "1px solid black"; procner.style.background = " Blue "; Pro.Style.zindex =" 102 "; Pro.Appendchild (Proinner);</p> <p>Var text = document.createElement ("div"); text.style.position = "absolute"; text.style.Left = "50px"; text.style.top = "2px"; text.style.fontsize = "11px "; Text.style.width =" 40px "; text.style.Height =" 16px "; text.style.zindex =" 103 "; div.appendchild (text);} function xysetProgresstop (pstyletop) {Try {var e = Document.all (this.xyProgressID); E.Style.top = PStyletop;} catch (e) {Alert (e.description);}}} function xysetprogressLEFT (PStyleleFT) {Try {var E = Document.all (this. XYPROGRESSID); E.Style.Left = PStylelerth;} Catch (e) {Alert (E.DESCRIPTION);}} Function XYSETPROGRESSWIDTH (PWIDTH) {Try {var E = Document.all (this.xyprogressID); E.Style. Width = PWidth; EOUTER = E.Children (0); EOUTER.Style.Width = PWidth; this.width = pWidth;} catch (e) {Alert (E.DESCRIPTION);}} Function XYSetProgressHeight (PHEIGHT) {TRY { VAR E = Document.all (this.xyprogressid); E.Style.Height = PHEIGHT; EOUTER = E.Children (0); ENNER = E.Children (0) .children (0); E Outer.style.height = pHeight; eInner.style.height = pHeight-4; this.height = pHeight;} catch (e) {alert (e.description);}} function xySetProgressBorderColor (pColor) {try {var e = Document.all (this.xyprogressid); E = E.Children (0); E.Style.Border = "1PX solid" pcolor;} catch (e) {alert (e.description);}} Function XySetProgressForeborderColor (Pcolor ) {Try {var e = document.all (this.xyProgressid); E = E.Children (0) .children (0); E.Style.Border = "1px solid" pcolor;} catch (e) {Alert (E.DESCRIPTION);</p> <p>}}} Function XYSETPROGRESSBACKCOLOR (Pcolor) {Try {var E = Document.all (this.xyProgressID); E.STILDREN (0); E.Style.Background = Pcolor;} catch (e) {Alert (E.DESCRIption }}}} Function xysetProgressForeColor (pcolor) {var E = document.all (this.xyProgressid); E = E.Children (0) .children (0); E.Style.Background = Pcolor;} catch (e ) {Alert (E.DESCRIPTION);}} Function XYenableProgresstext (Benable) {Try {var E = Document.all (this.xyProgressID); ETEXT = E.Children (1); if (Benable) {EText.Style.display = "none";} else {eText.Style.display = "";} var POS = E.Style.width; var sa = eText.style.width; POS = (POS-SEL) / 2; eText.Style. LEFT = POS;} Catch (e) {Alert (E.DESCRIPTION);}}} Function XYSETPROGRESSTEXTFONTSIZE (PSIZIZE) {Try {var E = Document.all (this.xyProgressID); E.Children (1); E. Style.fontsize = psize;} catch (e) {alert (e.description);}} Function XYSETPROGRESSTEXTFONTCOLOR (Pcolor) {Try {var E = Document.all (this.xyprogr ESSID); E = E.Children (1); E.Style.FontColor = Pcolor;} Catch (e) {Alert (E.DESCRIPTION);}} Function XYSetProgressTextFontFamily (pfamily) {Try {var E = Document.All THIS.XYPROGRESSID); E = E.Children (1); E.Style.FontFamily = PFamily;} Catch (e) {Alert (E.DESCRIPTION);}} Function XYSetProgressMax (pmax) {this.max = pmax;} Function XYSETPROGRESSMIN (PMIN) {this.min = Pmin;} Function XyupdatePosition (PPosition) {/ * Growing Progress or Reduces PPosition, where 0 <pPersent <max * / try {var max = this.max; var min = THIS.MIN; VAR E = Document.all (this.xyProgressID); if (pposition> max) {Return -1;</p> <p>VAR LEN = this.width; var pos = this.currpos (pposition / (max-min)) * Len; eProgress = E.Children (0) .children (0); if (pOS> = this.width) { EPROGRESS.STYLE.WIDTH = this.width-4; this.currpos = POS;} else if (POS <= 0) {EPROGRESS.StyLe.Width = 0; this.Currpos = POS;} else {EPROGRESS.Style.Width = POS; this.currpos = POS;} Return this.currpos;} catch (e) {alert (e.description); return -1;}} function xyupdatetoposition (pposition) {/ * updated Progress to the PPosition location, where , MIN <PPERSENT <max * / try {var max = this.max; var min = this.min; var e = document.all (this.xyprogressid); if (PPosition <min || pposition> max) {return - 1; VAR LEN = this.width; var pOS = (pPosition-min)) * Len; EPROGRESS = E.Children (0) .children (0); if (POS> = this. Width) {EPROGRESS.Style.Width = this.width-4; this.currpos = POS;} else if (POS <= 0) {EPROGRESS.StyLeLe.Width = 0; this.Currpos = POS;} else {EPROGRESS. Style.Width = POS; this.currpos = POS; Return this.currpos;} catch (e) {alert (e.description); return -1;}} function xyupdatepersnt (ppersent) {/ * grows from the current location or decreases pPersent%, PPERSENT is greater than zero: growth, otherwise, Decrease * / try {var e = document.all (this.xyprogressid); E = E.Children (0) .children (0); var len = this.width; var pos = this.currpos; len = len * PPERSENT / 100; POS = LEN; IF (POS> this.width || POS <0) {return -1;} E.Style.Width = POS; this.currpos = pos; return this.currpos;} catch e) {alert (e.description); retURN -1;</p> <p>}}} Function xyupdatetopersent (PPERSENT) {/ * grows or decreases from the current location to pPersent% * / try {var e = document.all (this.xyprogressid); E = E.Children (0) .children (0); Var len = this.width; var pos = len * ppersent / 100; if (pos> this.width || POS <0) {return -1;} E.Style.width = POS; this.currpos = pos; return THIS.CURRPOS;} catch (e) {Alert (e.description); Return -1;}} Function XYNewId () {var D = new date (); var t = "odraw _" D.getTime (). Tostring ();} </ Script> </ head> <body TopMargin = 0 id = "bodyid"> <script> var xy = new xyprogresslg ("kitty"); xy.setprogressLEFT (200) XY.SetProgResStop 200); XY.SetProgressWidth (200) XY.SetProgressHeight (20) xy.setprogressmax (200) xy.setprogressmin (50);</p> <p></ script> <script language = "javascript"> function update () {xy.UpdatePosition (10) Settimeout ("Update ()", 100);}</p> <p></ Script> <button οnclick = "xy.updatetopersent (20)> Update </ button> <button οnclick =" xy.UpdatePosition (10)> UpdatePosition </ button> <button οnclick = "Update ()>> Autoupdate </ button> </ body> </ html></p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-26468.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="26468" 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.047</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 = 'd9PtOyinFbYczS_2FwIgVJ0h2sfxP0L_2BsPk_2BLXAP69O_2FR8Z1r3_2FTamV1gsrUDLrhK7y_2BpqK3qXRWnejNvU8HbJNw_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>