- 浏览: 784694 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (386)
- Linux (36)
- Tomcat (6)
- windows (8)
- Apache (10)
- Java (25)
- jquery (7)
- Jquery 插件 (3)
- Oracle (5)
- Oracle SQL (68)
- Spring (15)
- 开发工具 (6)
- Struts (20)
- js (14)
- Project Code (2)
- Project Code Tomcat (1)
- libset (1)
- JSP (8)
- arithmetic (2)
- 浏览器 (1)
- extjs (3)
- 学习网站 (5)
- 生活情感 (0)
- 电话号码算法 (3)
- 快捷键 (1)
- 转载 (1)
- Dos命令 (2)
- services (1)
- Resources (1)
- 行业积累 (3)
- 项目积累 (3)
- Web (3)
- 文档 (1)
- JavaEE (2)
- JSF (3)
- http (3)
- JS窗口 (1)
- Html (4)
- Flex (1)
- 资讯 (2)
- 项目规范 (1)
- Struts s:property textarea中默认值用 (1)
- Quartz 2.0.2 (12)
- 1天有多少毫秒 (1)
- 专题 (1)
- intellij idea 10 CD-KEY (1)
- restlet (4)
- Mail (1)
- Excel (3)
- Menu (1)
- Big Data技术综述 (1)
- Quart 1 (1)
- nosql (1)
- linux远程 (1)
- jdk (5)
- wind7 (1)
- 虚拟人 (0)
- 虚拟机 (1)
- 终端 (1)
- Ubuntu (16)
- Myeclipse (2)
- Wmware (1)
- eclipse (2)
- css (2)
- csv (1)
- 开源 (1)
- plsql (2)
- cassandra (4)
- maven (1)
- hadoop (2)
- mysql (1)
- spring security (1)
- tools (1)
- jdbc (2)
- exception (2)
- 硬盘数据备份 (1)
- dwr (1)
- svn (1)
- PowerDesigner15使用时的十五个问题 (1)
- tomcat 项目发部路径 (1)
- js 暂停执行 (1)
- jquery jqgrid 格式化数据显示 (1)
- js 代码模板 (1)
- strutss2 直接跳转到jsp页面 (1)
- servlet (1)
- jdbc spring (1)
- js学习网站 (1)
- 自学考试 (2)
- hibernate (2)
- eos (1)
- c (4)
- 黑马 (2)
- 大数据 (2)
- 实战云大数据案例分享 (0)
- Spark (2)
- Flink (1)
最新评论
-
coosummer:
推荐使用http://buttoncssgenerator.c ...
jquery button 漂亮 -
thinktothings:
Array_06 写道你好,我是一名刚毕业学生,我以后就是做J ...
如何转型架构师 -
thinktothings:
软考,考有职业资格证,有系统的知识体系学习
如何转型架构师 -
Array_06:
你好,我是一名刚毕业学生,我以后就是做Java的架构师,那请问 ...
如何转型架构师 -
beykery:
你这也太复杂了。。。。jsf2不应该是这样的。。。。
JSF2.0的一个简单Demo
Updated: Dec 17th, 10" (v1.5): Updated menu shadow to use CSS3 box shadows when the browser is FF3.5+, IE9+, Opera9.5+, or Safari3+/Chrome. Only .js file changed.
Description: Smooth Navigation Menu is a multi level, CSS list based menu powered using jQuery that makes website navigation a smooth affair. And that's a good thing given the important role of this element in any site. The menu's contents can either be from direct markup on the page, or an external file and fetched via Ajax instead. And thanks to jQuery, a configurable, sleek "slide plus fade in" transition is applied during the unveiling of the sub menus. The menu supports both the horizontal and vertical (sidebar) orientation.
Some noteworthy features- You can specify a delay before the sub menus appear and disappear when the mouse rolls over and out of them, respectively. The sub menus reposition themselves if too close to the window's right edges. And last but not least, the depth of the accompanying shadow can be customized, or removed altogether. Smooth we say!
Step 1: Insert the following code into the <head> section of your page:
The above code references a few external files, which by default you should upload to the same directory as the page itself (right click each file and select "Save As"):
Step 2: Add the below menu code to the BODY section of your page. It contains the markup for 1 horizontal menu and 1 vertical menu:
Each menu should consist of an outer DIV and a valid UL list contained inside it.
If you wish the menu content to reside in an external file on your server and dynamically added to your page(s), read the section "Putting the Menu contents in an external file" below.
Well, that's it for installation.
ddsmoothmenu.init()
and Menu content structure
Setting up a Smooth Navigational Menu on your page involves calling
ddsmoothmenu.init()
inside the HEAD section of your page:
ddsmoothmenu.init({
mainmenuid: "smoothmenu1", //menu DIV id
orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
classname: 'ddsmoothmenu', //class added to menu's outer DIV
//customtheme: ["#1c5a80", "#18374a"],
contentsource: "markup" //"markup" or ["container_id",
"path_to_menu_file"]
})
where "smoothmenu1
" corresponds to the menu content's outermost DIV
on the page. Here's a description of each option:
Attribute | Description |
mainmenuid |
The ID of the menu's outermost DIV. If the menu contents are fetched via Ajax, then this ID should correspond to the outermost DIV that's within the external file. |
orientation |
Sets the orientation of the menu. Enter the
value "h" or "v" for a horizontal or vertical menu, respectively. Note
that the "classname " setting below must also be set
according to the "orientation " setting. |
classname |
Sets the CSS class name that gets applied to
the outermost DIV of the menu, effectively styling it. Based on the "orientation "
setting above, you want to enter the CSS class that correctly styles the
menu By default, "ddsmoothmenu " creates a horizontal menu
bar, while "ddsmoothmenu-v " creates a vertical one. Take a
look inside
ddsmoothmenu.css and
ddsmoothmenu-v.css. |
customtheme |
In general, customizing the menu's style and background colors
is done by editing the two CSS files of the script.
However, you can also modify the menu's background and hover background
color- on
a per page or per menu basis easily, by taking advantage of the "customtheme "
setting. To do so, uncomment (remove the // prefix) from
this setting and declare two CSS background values, one for the default state, the
other, when the mouse rolls over the menu items:
customtheme: ["#1c5a80", "#18374a"], //override default menu CSS background values? Uncomment: ["normal_background", "hover_background"] This property is useful for quickly testing out color combinations without having to edit "ddsmoothmenu.css" each time. |
contentsource |
Enter "markup " if your
menu contents are directly inline on the page, or ["container_id",
"path_to_menu_file"] For more info on the later option, see "Putting the Menu contents in an external file and fetched using Ajax"
below. |
Menu content structure
As far as the HTML markup of each menu, it should consist of an outer DIV plus a valid UL list inside it, such as:
<div id="smoothmenu1">
<ul>
<li><a href="http://www.dynamicdrive.com">Item 1</a></li>
<li><a href="#">Folder 0</a>
<ul>
<li><a href="#">Sub Item 1.1</a></li>
<li><a href="#">Sub Item 1.2</a></li>
</ul>
</li>
</ul>
</div>
Make sure the UL list is valid You can use W3C's validation service to quickly check your HTML list for incorrectly nested or unclosed tags.
Putting the Menu contents in an external file and fetched using Ajax
Instead of the menu's content being direct markup on the page, you can instead put that HTML in an external file on your server and have the menu dynamically added to the BODY of your page using Ajax. The above menu is embedded this way. The process for this is simple enough:
- Move the entire menu's HTML markup- including the outermost DIV container- to an external file on your server. For example: "smoothmenu.htm"
- On your page(s) themselves where you want the menu to be dynamically
added, add an empty DIV container with a unique ID of its own in the BODY
section of the page:<div id="smoothcontainer">
<noscript>
<a href="link to site map for search engines and user with JS disabled">Site map</a>
</noscript>
</div>
This container's contents will be replaced by the menu contents defined in your external file whenddsmoothmenu.init()
is run. You can include any HTML within this empty container that you may want shown to search engines or users with JavaScript disabled, as it will be replaced when the script is run. - Finally, you need to edit
ddsmoothmenu.init()
's "contentsource
" setting to the appropriate setting :
ddsmoothmenu.init({
mainmenuid: "smoothmenu-ajax",
//customtheme: ["#1c5a80", "#18374a"], //override default menu CSS background values? Uncomment: ["normal_background", "hover_background"]
contentsource: ["smoothcontainer", "smoothmenu.htm"] //"markup" or ["container_id", "path_to_menu_file"]
})The path to the external file, in this case "smoothmenu.htm", should be a relative path to it based on the current page's position within your site.
Styling the menu item the user is currently at
When the user rolls over a menu item (LI element) that contains a sub menu
(UL element), the script dynamically adds a CSS class of ".selected
"
to the former's inner A element. This allows you to style the current active
menu item differently from the rest. Inside "ddsmoothmenu.css",
the relevant CSS you'll want to tweak is:
.ddsmoothmenu ul li a.selected{ /*CSS class that's
dynamically added to the currently active menu items' LI A element*/
background: black;
color: white;
}
Global menu settings
Finally inside ddsmoothmenu.js there are a few global settings you can modify, such as setting the paths to the arrow images, speed of animation, and whether to disable shadows:
arrowimages: {down:['downarrowclass', 'http://www.cssdrive.com/lib/down.gif',
23], right:['rightarrowclass', 'right.gif']},
transition: {overtime:300, outtime:300}, //duration of slide in/ out animation,
in milliseconds
shadow: {enable:true, offsetx:5, offsety:5}, //enable shadow?
showhidedelay: {showdelay: 100, hidedelay: 200}, //set delay in milliseconds
before sub menus appear and disappear, respectively
The last line above lets you specify the delay before the sub menus appear and disappear when the mouse rolls over and out of them, respectively.
- ddsmoothmenu.zip (31.8 KB)
- 下载次数: 1
发表评论
-
js 替换字符串
2013-03-06 20:48 1172js 替换字符串 <script langua ... -
跟着滚动条动
2013-01-18 06:22 925跟着滚动条动 http://www.opusonline. ... -
js字符串换为json对象
2012-12-27 11:58 1053js字符串换为json对象 var data=J ... -
js设置父 iframe的高度
2012-12-12 11:08 1389js设置父 iframe的高度 ... -
js 不为空 验证
2012-12-02 23:46 1173<!DOCTYPE html PUBLIC &qu ... -
frame 重新加载
2012-11-15 09:30 5162<script type="text/j ... -
js 文本框只能输入整数
2012-11-03 09:28 2769<html> <body> ... -
js 复选框选中 struts taglib
2012-10-23 09:49 902$("#id_is_adult").att ... -
Jquery清空文本框
2011-07-22 09:21 2722<script type="text/java ... -
JS键码
2011-07-18 14:38 1207左键盘: 12345678对应的KeyCode 1 ... -
JS关闭新打开的页面时,重新加载父页面
2011-02-18 08:58 9033打开主页面 index.jsp,单击修改跳出一个小的修改页面e ... -
jquery获得浏览器请求参数值
2011-02-15 13:23 5589<script type="text/java ... -
JS超链接的应用
2010-10-25 20:13 1434转载:http://hi.baidu.com/luo_qing ...
相关推荐
总的来说,选择哪种JavaScript菜单技术取决于项目需求、性能考虑以及开发者的熟练程度。在实际应用中,开发者可能会根据具体情况组合使用这些技术,以达到最佳的用户体验和性能效果。在学习和实践中,理解每种技术的...
"35个JavaScript菜单菜单样式"是一个资源包,提供了多种设计独特的菜单样式,旨在帮助开发者提升网站或应用的用户体验。 在网页设计中,菜单是一个重要的导航元素,它允许用户轻松地浏览网站的不同部分。JavaScript...
总的来说,这个“js 菜单大全”集合是一个宝贵的资源,无论你是初学者还是经验丰富的开发者,都可以从中学习到JavaScript菜单设计的各种技巧和最佳实践。通过深入理解和实践这些示例,你可以提升自己的前端开发技能...
js 菜单js 菜单js 菜单js 菜单js 菜单js 菜单js 菜单js 菜单js 菜单js 菜单js 菜单js 菜单js 菜单js 菜单js 菜单js 菜单js 菜单js 菜单js 菜单js 菜单js 菜单js 菜单js 菜单js 菜单js 菜单js 菜单js 菜单js 菜单js ...
"Basic"可能是一个基础的JavaScript菜单,展示了最简单的下拉或弹出菜单的基本结构。这包括如何使用JavaScript操作DOM元素(如添加和删除class,显示和隐藏元素)以及响应用户事件。 4. **Drop Shadow** "Drop ...
总的来说,"仿淘宝商城左侧JS菜单"项目是学习和实践前端开发技能的好案例,涵盖了CSS布局、JavaScript交互以及现代WEB开发中的诸多技巧。通过这样的实践,开发者可以提高自己在网站设计和用户体验方面的专业能力。
本文将深入探讨"Js右键菜单,js菜单,漂亮的Js右键导航,好用的Js右键菜单"这一主题,帮助开发者了解如何利用JavaScript实现高效、美观的右键菜单功能。 一、JavaScript右键菜单的基本原理 在网页上,右键点击事件...
div+css+js菜单 div+css+js菜单 div+css+js菜单 div+css+js菜单 div+css+js菜单 div+css+js菜单 div+css+js菜单 div+css+js菜单 div+css+js菜单
通过分析和调试这个文件,我们可以更深入地了解如何在JSP中构建仿Outlook的JavaScript菜单。 总的来说,"jsp的仿outlook的js菜单"是一个结合了JavaScript、JSP和CSS技术的项目,它展示了如何通过这些技术来创建交互...
"CSS+JavaScript 菜单"就是这样一个技术组合,用于构建动态、响应式且功能丰富的导航元素。下面将详细讲解CSS和JavaScript在创建这种菜单中的作用,以及如何将两者结合使用。 首先,CSS(Cascading Style Sheets)...
JavaScript(Js)是一种广泛应用于网页和网络应用的脚本语言,它主要负责处理客户端的交互逻辑,让网页更具动态性和用户友好性。在网页设计中,菜单是必不可少的一部分,它帮助用户快速导航到不同的页面或功能。而...
首先,我们关注的是JS(JavaScript)在创建动态导航菜单中的作用。JavaScript是一种强大的客户端脚本语言,它允许开发者为网页添加交互性,使得导航菜单不仅美观,而且具有响应性和自定义功能。JS菜单通常包括下拉...
JavaScript菜单树是一种基于JavaScript编程语言构建的动态导航菜单,它以树形结构展示数据,用户可以通过展开和折叠节点来查看或隐藏子级菜单。这样的设计使得大量层级关系的数据变得易于理解和操作,尤其适用于网站...
该压缩包文件提供的“菜单js模板”包含样式代码和示例,意味着它不仅包含了JavaScript逻辑,还可能包括CSS样式,用于控制菜单的外观。通过引入这个模板,开发者无需从零开始编写菜单代码,可以节省大量时间和精力,...
在JavaScript的世界里,创建动态和交互式的用户界面是常见的需求,而“js菜单 鼠标经过折叠/滑动菜单”就是这样的一个功能。这种菜单设计可以极大地提升网站的用户体验,因为它允许用户通过简单地将鼠标悬停在菜单项...
总的来说,"js菜单.rar"提供的资源是一个实用的JavaScript菜单解决方案,涵盖了事件处理、DOM操作、数据持久化和动态效果等多个JavaScript核心概念。无论是初学者还是经验丰富的开发者,都能从中学习到关于...
JavaScript(简称JS)是一种轻量级的解释型编程...以上就是关于"js菜单(sd-menu)"的一些关键知识点,涵盖了JavaScript菜单实现的基本原理和常见实践。掌握这些技能,开发者可以创建出符合各种需求的交互式菜单系统。
资源名:asp.net动态js菜单源码(动态菜单+静态菜单+数据库文件) 资源类型:程序源代码 源码说明: 1.Default.aspx页面是框架,需要静态菜单显示或是动态菜单显示,设置起始页。Login页面或LoginStatic页面。 2.运行 ...
在这个"js菜单[简单实用]"的项目中,我们可以看到一个基本的JavaScript菜单实现,适用于那些希望用JS来控制动态菜单的开发者。 首先,"index.html"是网页的主文件,通常包含HTML结构以及内联或外部引用的CSS和JS...
JavaScript(简称JS)和jQuery是Web开发中用于创建交互式用户界面的重要工具,尤其是在构建菜单系统时。在本文中,我们将深入探讨如何使用这两种技术来创建高效、灵活且跨浏览器的横纵向菜单。 首先,JavaScript是...