本文实例讲述了JS实现新浪博客左侧的Blog管理菜单效果代码。分享给大家供大家参考,具体如下:
这里介绍新浪博客左侧的Blog管理菜单,我们变通一下,如果你在设计程序,那么本款菜单用到后台管理中想必应该很合适吧,图片是调用新浪的,用了比较多的图片,你用的时候最好是下载到本地,以免新浪哪天改版了,你就傻了。
运行效果截图如下:
在线演示地址如下:
http://demo.jb51.net/js/2015/js-sina-blog-left-menu-style-codes/
具体代码如下:
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>新浪博客左侧的管理菜单</title> <style type="text/css"> <!-- body{margin:0;padding:0;background:url("images/bg.gif")} body, td{font-size:12px} .menu_box_pad{background:#fdf9d5;padding:0 2px 2px 2px} .menu_box{border-top:1px solid #ababab;border-left:1px solid #ababab;border-right:1px solid #d6d6d6;border-bottom:1px solid #d6d6d6} .menu_box th{background:url('images/menu_list_icon.gif') no-repeat center;line-height:22px;width:10px} .menu_box td{background:url('images/menu_list_split.gif') no-repeat left bottom;line-height:20px} .menu_box a{text-decoration:none;color:#000} .menu_box a:hover{text-decoration:underline} .hand{cursor:hand;cursor:pointer} .ctrl_menu{border-left:1px solid #767676;border-bottom:1px solid #767676;border-right:1px solid #767676;background:#ffcf60} .ctrl_menu_title{padding-left:15px;font-weight:bold;line-height:25px} .ctrl_menu_title_bg{background:url('images/menu_title_bg.gif')} .top_bg{background:url("images/top_bg.gif")} .logo_bg{background:url("images/logo_bg.gif")} #top_nav_menu {color:#fff} #top_nav_menu a{text-decoration:none;color:#fff} #top_nav_menu a:hover{text-decoration:underline;color:#ff6} --> </style> <script> function $(_sId){ return document.getElementById(_sId); } function exist(_sId){ var oObj = $(_sId); return oObj != null ? oObj : false; } function dw(_sTxt){ document.write(_sTxt); } function hide(_sId){ $(_sId).style.display = $(_sId).style.display == "none" ? "" : "none"; } function onlyShow(_sId, _iNum, _sPic, _sTxt1, _sTxt2){ var i = 0; var oCurr = exist(_sId + i); while(oCurr){ oCurr.style.display = "none"; $(_sPic + i).src = _sTxt2; i++; oCurr = exist(_sId + i) } $(_sId + _iNum).style.display = ""; $(_sPic + _iNum).src = _sTxt1; } function swapShow(_sId){ var i = 0; var oCurr = exist(_sId + i); while(oCurr){ hide(_sId + i); i++; oCurr = exist(_sId + i) } } function seekKey(_sKey){ var i = 0; while(exist(_sKey + i)){ i++; } return i; } function swapPic(_sId,_sAttr,_sTxt1, _sTxt2) { $(_sId)[_sAttr] = $(_sId)[_sAttr].indexOf(_sTxt1) > -1 ? _sTxt2 : _sTxt1; } function swap(_sId,_sAttr,_sTxt1, _sTxt2) { $(_sId)[_sAttr] = $(_sId)[_sAttr] == _sTxt1 ? _sTxt2 : _sTxt1; } function moveGif(_sId){ swap(_sId,'className','marginLeft2',''); } function moveStart(_sId){ __tmp__time = setInterval("moveGif('" + _sId + "')",200); } function moveStop(_sId){ clearInterval(__tmp__time); $(_sId).className = "marginLeft2"; } function switchShow(){ hide('left'); swapPic('arrow','src','images/control_switch_up.gif','images/control_switch_down.gif'); swapShow('hideLeft'); swapShow('hideBody'); } function scroll_to_top() { document.body.scrollTop=0; } function mainFrameRedirect(url) { oo = document.getElementById("mainFrame"); oo.url = url; } </script> </head> <body> <table align="left" width="220" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="50" align="left" valign="top"> <!-- 控制面板菜单 --> <table width="205" border="0" cellspacing="0" cellpadding="0" class="ctrl_menu"> <tr height="5"><td></td></tr> <tr> <td align="center"> <!-- BLOG文章 --> <table width="195" border="0" cellspacing="0" cellpadding="0" class="ctrl_menu_title_bg"> <tr class="hand" onClick="hide('hideMenuFunc3')"> <td width="174" class="ctrl_menu_title">BLOG文章管理</td> <td width="21"><image id='MenuFunc3' src="images/menu_title_down.gif"></td> </tr> <tr id="hideMenuFunc3"> <td align="left" colspan="2" class="menu_box_pad"> <table width="100%" border="0" cellspacing="5" cellpadding="0" class="menu_box"> <tr> <th> </th> <td><a href="#" target="mainFrame" onClick="scroll_to_top()">发表BLOG文章</a></td> </tr> <tr> <th> </th> <td><a href="#" target="mainFrame" onClick="scroll_to_top()">BLOG文章管理</a></td> </tr> <tr> <th> </th> <td><a href="#" target="mainFrame" onClick="scroll_to_top()">BLOG评论管理</a></td> </tr> </table> </td> </tr> </table> <!-- /BLOG文章 --> </td> </tr> <tr height="5"><td></td></tr> <tr> <td align="center"> <!-- BLOG信息 --> <table width="195" border="0" cellspacing="0" cellpadding="0" class="ctrl_menu_title_bg"> <tr class="hand" onClick="hide('hideMenuFunc2')"> <td width="174" class="ctrl_menu_title">BLOG信息设置</td> <td width="21"><image id='MenuFunc2' src="images/menu_title_down.gif"></td> </tr> <tr id="hideMenuFunc2"> <td align="left" colspan="2" class="menu_box_pad" > <table width="100%" border="0" cellspacing="5" cellpadding="0" class="menu_box"> <tr> <th> </th> <td><a href="#" target="mainFrame" onClick="scroll_to_top()">更改基本信息</a></td> </tr> <tr> <th> </th> <td><a href="#" target="mainFrame" onClick="scroll_to_top()">定制我的模板</a></td> </tr> <tr> <th> </th> <td><a href="#" target="mainFrame" onClick="scroll_to_top()">首页内容维护</a></td> </tr> </table></td> </tr> </table> <!-- /BLOG信息 --></td> </tr> <tr height="5"><td></td></tr> <tr> <td align="center"> <!-- 个人信息 --> <table width="195" border="0" cellspacing="0" cellpadding="0" class="ctrl_menu_title_bg"> <tr class="hand" onClick="hide('hideMenuFunc1')"> <td width="174" class="ctrl_menu_title">个人信息设置</td> <td width="21"><image id='MenuFunc1' src="images/menu_title_down.gif"></td> </tr> <tr id="hideMenuFunc1" style="display:none"> <td align="left" colspan="2" class="menu_box_pad"> <table width="100%" border="0" cellspacing="5" cellpadding="0" class="menu_box"> <tr> <th> </th> <td><a target="mainFrame" href="#" onClick="scroll_to_top()">更改基本资料</a></td> </tr> <tr> <th> </th> <td><a target="mainFrame" href="#" onClick="scroll_to_top()">登录默认选项</a></td> </tr> </table> </td> </tr> </table> <!-- /个人信息 --> </td> </tr> <tr height="5"><td></td></tr> </table> </body> </html>
希望本文所述对大家JavaScript程序设计有所帮助。

JavaScript在Web开发中的主要用途包括客户端交互、表单验证和异步通信。1)通过DOM操作实现动态内容更新和用户交互;2)在用户提交数据前进行客户端验证,提高用户体验;3)通过AJAX技术实现与服务器的无刷新通信。

理解JavaScript引擎内部工作原理对开发者重要,因为它能帮助编写更高效的代码并理解性能瓶颈和优化策略。1)引擎的工作流程包括解析、编译和执行三个阶段;2)执行过程中,引擎会进行动态优化,如内联缓存和隐藏类;3)最佳实践包括避免全局变量、优化循环、使用const和let,以及避免过度使用闭包。

Python更适合初学者,学习曲线平缓,语法简洁;JavaScript适合前端开发,学习曲线较陡,语法灵活。1.Python语法直观,适用于数据科学和后端开发。2.JavaScript灵活,广泛用于前端和服务器端编程。

Python和JavaScript在社区、库和资源方面的对比各有优劣。1)Python社区友好,适合初学者,但前端开发资源不如JavaScript丰富。2)Python在数据科学和机器学习库方面强大,JavaScript则在前端开发库和框架上更胜一筹。3)两者的学习资源都丰富,但Python适合从官方文档开始,JavaScript则以MDNWebDocs为佳。选择应基于项目需求和个人兴趣。

从C/C 转向JavaScript需要适应动态类型、垃圾回收和异步编程等特点。1)C/C 是静态类型语言,需手动管理内存,而JavaScript是动态类型,垃圾回收自动处理。2)C/C 需编译成机器码,JavaScript则为解释型语言。3)JavaScript引入闭包、原型链和Promise等概念,增强了灵活性和异步编程能力。

不同JavaScript引擎在解析和执行JavaScript代码时,效果会有所不同,因为每个引擎的实现原理和优化策略各有差异。1.词法分析:将源码转换为词法单元。2.语法分析:生成抽象语法树。3.优化和编译:通过JIT编译器生成机器码。4.执行:运行机器码。V8引擎通过即时编译和隐藏类优化,SpiderMonkey使用类型推断系统,导致在相同代码上的性能表现不同。

JavaScript在现实世界中的应用包括服务器端编程、移动应用开发和物联网控制:1.通过Node.js实现服务器端编程,适用于高并发请求处理。2.通过ReactNative进行移动应用开发,支持跨平台部署。3.通过Johnny-Five库用于物联网设备控制,适用于硬件交互。

我使用您的日常技术工具构建了功能性的多租户SaaS应用程序(一个Edtech应用程序),您可以做同样的事情。 首先,什么是多租户SaaS应用程序? 多租户SaaS应用程序可让您从唱歌中为多个客户提供服务


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

MinGW - 适用于 Windows 的极简 GNU
这个项目正在迁移到osdn.net/projects/mingw的过程中,你可以继续在那里关注我们。MinGW:GNU编译器集合(GCC)的本地Windows移植版本,可自由分发的导入库和用于构建本地Windows应用程序的头文件;包括对MSVC运行时的扩展,以支持C99功能。MinGW的所有软件都可以在64位Windows平台上运行。

DVWA
Damn Vulnerable Web App (DVWA) 是一个PHP/MySQL的Web应用程序,非常容易受到攻击。它的主要目标是成为安全专业人员在合法环境中测试自己的技能和工具的辅助工具,帮助Web开发人员更好地理解保护Web应用程序的过程,并帮助教师/学生在课堂环境中教授/学习Web应用程序安全。DVWA的目标是通过简单直接的界面练习一些最常见的Web漏洞,难度各不相同。请注意,该软件中

SecLists
SecLists是最终安全测试人员的伙伴。它是一个包含各种类型列表的集合,这些列表在安全评估过程中经常使用,都在一个地方。SecLists通过方便地提供安全测试人员可能需要的所有列表,帮助提高安全测试的效率和生产力。列表类型包括用户名、密码、URL、模糊测试有效载荷、敏感数据模式、Web shell等等。测试人员只需将此存储库拉到新的测试机上,他就可以访问到所需的每种类型的列表。

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)

记事本++7.3.1
好用且免费的代码编辑器