如何使用jQuery ui 分享心得
2013-07-25 11:20
591 查看
首先我要说明的是,老鸟就可以先飞走~\(≧▽≦)/~啦啦啦,希望下面的对你学习jquery ui有用~\(≧▽≦)/~啦啦啦
1. 首先创建一个web工程,在Webcontent目录下新建一个名为button的JSP文件
2.代码如下
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>jQuery UI Button - Default functionality</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<script>
$(function() {
$( "input[type=button], a, button" )
.button()
.click(function( event ) {
event.preventDefault();
});
});
</script>
</head>
<body>
<button>new button
</button>
<input type="button" value="your button" />
</body>
</html>
</body>
</html>
3 运行效果如下
4打开官方网站:http://jqueryui.com/ 点击button -view source -发现一段代码,没错就和我上面的代码差不多~\(≧▽≦)/~啦啦啦这就是最简单小工具配上ui 效果图啦啦
5下面你可以调试Accordion Dialog Menu Tabs Slider Spinner 等等工具试试,方法和上面的差不多啦,把view source代码复制到自己的jsp文件里面就可以运行了。
6上面的是通过网上访问css 和js如图可以知道
7下面要使用本地连接到自己的js 和css文件那么先到官方网站theme-gallery 选择你喜欢的主题,我选择的是ui-darkness-点击download 下载
解压jquery-ui-1.10.3.custom.zip把css里面 的ui-darkness和js 文件复制到工程文件Webcontent中如图所示
最后修改代码:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>jQuery UI Button - Default functionality</title>
<link rel="stylesheet" href="css/ui-darkness/jquery-ui-1.10.3.custom.css" />
<script src="js/jquery-1.9.1.js"></script>
<script src="js/jquery-ui-1.10.3.custom.min.js"></script>
<script src="js/jquery-ui-1.10.3.custom.css"></script>
<script>
$(function() {
$( "input[type=button], a, button" )
.button()
.click(function( event ) {
event.preventDefault();
});
});
</script>
</head>
<body>
<button>new button</button >
<input type="button" value="your button" />
</body>
</html>
</body>
</html>
最后运行效果图如下
希望对大家有用
相关文章推荐
- win2003系统硬盘如何保持稳定使用心得分享
- Win7下如何正常安装使用AutoCAD2006心得分享
- BCGControlBar使用心得--如何捕获Workspace bar类上的树控件的消息
- 使用python开发vim插件及心得分享
- Axure使用心得分享
- 分享两款.NET电子表格组件的使用心得
- 学习FPGA verilog的心得--编程技巧--如何写代码减少逻辑单元的使用数量
- ORM,ASP.NET中ORM学习,ASP.NET中ORM学习心得,WEB2.0中ORM实现原理,Asp.net简单ORM示例源码详细讲解,Asp.net2.0:如何使用ObjectDataSource(配合ORM )(二)
- 分享如何使用通用Mapper
- 分享Ctrlbox项目管理软件的财务管理使用心得
- 技术分享 如何在Flex中使用Json
- JAVA开发:分享一些SpringMvc+Ibatis+spring的框架使用心得
- 一个经典的PHP文件上传类分享 使用心得
- 如何使用Android Studio把自己的Android library分享到jCenter和Maven Central
- 如何自定义博客园代码高亮主题,同时分享自己使用的黑色主题
- 小白如何使用Android Studio把自己的Android library分享到jCenter
- 关于jQuery UI 使用心得及技巧