JavaScripts menu Demo

xiaoxiao2021-03-06  16

AGetimeMenu demo </ title> <meta http-equiv = "content-type" content = " TEXT / HTML; Charset = GB2312 "> <style> .agetime_bar {position: absolute; Top: 0px; Left: 0px; height: 22px; width: 100%; border: 1px outset; Background-Color: RGB (212, 208, 200); Z-Index: 98;} .agetime_baritem {width: 60px; Height: 20px; Border: 1px Solid RGB (212, 208, 200); Text-Align: Left; Padding-Left: 10px; Background: RGB (212, 208,200); color: # 000000 Font-size: 9pt;} .agetime_baritemdown {width: 60px; Height: 20px; Border: 1px INSET RGB (212, 208, 200); Text-Align: Left; padding-left: 10px; Background: # f0f0f0; color: # 000000; Font-size: 9pt;} .agetime_baritemhover {width: 60px; Height: 20px; border: 1 out; paper; padding-left: 10px; background: #f0f0f0; color: # 000000; font-size: 9pt ;} .Agetime_pad {cursor: default; font-size: 9pt; width: 100%;} .agetime_paditem {width: 100%; Height: 18px; Border: 1px Solid RGB (212, 208, 200); Text-Align: Left; Padding- LEFT: 10PX; Background: RGB (212, 208, 2 00); color: # 000000; font-size: 9pt;} .agetime_paditemfalse {padding-left: 10px; font-size: 9pt; color: # 808080;} .agetime_paditemfalsehover {padding-left: 10px; font-size: 9pt: 10px; font-size: 9pt: 10px; font-size: 9pt: 10px; font-size: 9pt Color: # 808080; Background-Color: # 333366;} .agetime_paditemhover {Width: 100%; Height: 18px; Text-Align: Left; padding-left: 10px; Background-Color: # 333366; color: #fffff; FONT-SIZE: 9pt;} .agetime_paditemdown {width: 100%; Height: 18px; Text-Align: Left; Padding-Left: 10px; Border: 1PX INSET; Background-Color: # 9999cc; color: #ffffff; font- Size: 9pt;} .agetime_hr {border: 1px INSET;} .agetime_board {background-color: RGB (212, 208, 200); border: 2px outset;} </ stop> </ head></p> <p><body> <script language = "javascript"> var menu = AgetimeMenu ("AGetime", [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[",状 栏 文 文 ["Open", NULL, NULL, FALSE, "Open File"], ["-", "Hello", "JS", "Alert ('Hello')", True, " A greeting "], [New Window", "ABC", "About: Blank", True, "Pophang ABC Window"], ["Blank", NULL, "About: blank", TRUE, "in the current window display Blank Page "]], [[[" Edit ", NULL, NULL, FALSE," Open File "], [Unwind", NULL, TRUE, "Open File"], ["Redo", NULL, NULL , True, "Open File"]], [["File", "JS", "Alert ('No Menu" ", True," Open File "]]); // When" JS " When the command is a JavaScript statement, when the "JS" value is not "JS" value, the command is a URL, and the target position of the URL is the window specified by the method; // [Hello "," JS "," Alert ('Hello'), true, "a greeting"]; // Display text is "-" is the button is a separator; Function AgetimeMenu (ID, Array) {var menu = this; menu.pad = null; / / Loading each submenu Menu.Baritems = []; // The button Menu.pads = [] // // per submenu is stored on menu.pad; menu.selectedIndex = -1; // Menu bar selection of the index value of the button Menu.board = null; // Sub-panel</p> <p>// Establish a menu strip this.crtMenubar = function () {var len = array.length; menu.bar = document.body.Appendchild ('Div')); menu.bar.classname = ID "_ bar" ; For (var i = 0; i <len; i ) {menu.baritems [i] = menu.addmenuBarItem (Array [i] [0], i); menu.addMenuPad (Array [i], i);} }</p> <p>// Sub-menu this.addMenuPad = function (ary, index) {var len = ary.length; var pad = menu.crtelement ("table", menu.pad); pad.cellspacing = 1; pad.cellpadding = 0; Pad.classname = ID "_ pad"; pad.style.display = "none"; for (var i = 1; i <len; i ) {var row = pad.insertrow (i-1); menu.addMenuPadItem (Ary [i], row);} menu.pads [index] = Pad;} // each submenu button this.addMenuPadItem = function (ary, row) {var cell = row.insertcell (0); if (Ary [0 ]! = "-") {Cell.innertext = ary [0]; if (ary [3]) {// valid status; cell.classname = ID "_ paditem"; cell.οnmοuseοver = function () {Cell. ClassName = ID "_ paditemhover"; window.status = ary [4];} Cell.οnmοuseοut = function () {cell.classname = ID "_ paditem"; window.status = "";} cell.οnusedοwn = function () { Cell.classname = ID "_ paditemdown";} cell.οnmοuseup = function () {cell.classname = ID "_ paditemhover"; menu.hideMenu (); menu.execute (ary);}} else {// button invalid; Cell .classname = ID "_ paditemfalse"; Cel l.οnmοuseοver = function () {Cell.className = id "_ padItemFalseHover"; window.status = ary [4];} Cell.οnmοuseοut = function () {Cell.className = id "_ padItemFalse"; window.status = "" }}} Else {var = menu.crtelement ("hr", cell); hr.classname = ID "_ hr";} Cell.οnclick = function () {Event.cancelbubble = true;}}</p> <p>// Menu bar button this.addmenubarItem = function (ary, index) {var item = menu.crtelement ("button", menu.bar); item.value = ary [0]; item.disabled =! Ary [3 ]; item.className = id "_ barItem"; item.οnmοuseοver = function () {if (menu.selectedIndex == - 1) {item.className = id "_ barItemHover";} else {menu.barItems [selectedIndex] .className = ID "_ baritem"; item.classname = ID "_ baritemdown"; menu.showmenu (index);} WINDOW.STATUS = ary [4];} item.οnmοuseοut = function () {ity (menu.selectedIndIndex == - 1 ) Item.classname = ID "_ barItem"; window.status = "";} item.οclick = function () {event.cancelbubble = true; if (menu.selectedIndex == - 1) {item.classname = ID _ baritemdown "; Menu.ShowMenu (index);} else {menu.hideMenu (); item.classname = ID " _ baritemhover ";} menu.execute (ary); item.blur ();} returni</p> <p>// Display submenu this.ShowMenu = function (index) {if (menu.selectedIndIndex! = - 1) menu.pads [selectedindex] .style.display = "none"; menu.board.style.pixelleft = menu.baritems [Index] .offsetleft 2; //menu.board.style.pixelheight= ""; if (menu.pads [index] .rows.Length> 0) Menu.board.style.display = ""; else menu. Board.style.display = "none"; menu.pads [index] .style.display = ""; menu.selectedIndIndex = index;} // hidden submenu this.HideMenu = function () {if (menu.selectedIndex = = -1) Return; menu.baritems [menu.selected ".ClassName = ID " _ baritem "; menu.pads [selectedindex] .Style.display =" none "; menu.selectedIndex = -1; menu.board.style. Display = "none";} // executing menu command; this.execute = function (ary) {if (ary [2] == null) return; if (ary [1] == "js") {EVAL (Ary [2]); menu.hidemenu ();} else if (ary [1] == null || ary [1] .tolowercase == "_ self") location.href = ary [2]; else {var x = WINDOW.OPEN (Ary [2], Ary [1]); x.focus ();}}</p> <p>// Establish a submenu Show THIS.CRTMENUBOARD = Function () {document.write ("<div id = '" id "_ Board' style = 'Position: absolute; width: 160px; height: 10px; Left: 0px Top: 20px; Background-Color: # 666666; z-index: 99; display: none; '> "<div style =' position: absolute; width: 100%; Height: 100%; Left: 0px; Top: 0px; '> " " <iframe id =' " id " _ frame 'name =' " id " _ frame 'width =' 100% 'Height =' 100% 'frameborder =' 0 'scrolling =' NO '> </ iframe> "<div id ='" id "_ pad 'style =' position: absolute; width: 100%; Height: 100%; Left: 0px; Top: 0px; '> </ div> " </ div>"); menu.board = document.getlementByid (ID "_ board"); menu.pad = document.getlementById (ID "_ pad"); menu.pad. ClassName = ID "_ board"; menu.pad.onselectionstart = function () {return false;}} // increased a child element this.crtelement = function (EL, P) {Return P.Appendchild (Document.createElement) (EL));</p> <p>// Installed menu; this.setup = function () {menu.crtMenuboard (); menu.crtmenubar (); document.attachevent ("onclick", menu.hidemenu);}</p> <p>Menu.setup ();} </ script> </ body> </ html></p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-67904.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="67904" 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.034</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 = 'DanLB1eI77eTXKSpzwB6ucqjpG7PP3KcSOWumTSY6UjG7TXDRCkLISV7s_2BkwbCjWnJthrjJKPQ119J_2FU5AVlcg_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>