如何使用jQuery ui 分享心得

   

      首先我要说明的是,老鸟就可以先飞走~\(≧▽≦)/~啦啦啦,希望下面的对你学习jquery ui有用~\(≧▽≦)/~啦啦啦

1.  首先创建一个web工程,在Webcontent目录下新建一个名为button的JSP文件

2.代码如下

  1. <%@ page language="java" contentType="text/html; charset=ISO-8859-1"  
  2.     pageEncoding="ISO-8859-1"%>  
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">  
  4. <html>  
  5. <head>  
  6. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">  
  7. <title>Insert title here</title>  
  8. </head>  
  9. <body>  
  10. <html lang="en">  
  11. <head>  
  12.   <meta charset="utf-8" />  
  13.   <title>jQuery UI Button - Default functionality</title>  
  14.   <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />  
  15.   <script src="http://code.jquery.com/jquery-1.9.1.js"></script>  
  16.   <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>  
  17.   <link rel="stylesheet" href="/resources/demos/style.css" />  
  18.   <script>  
  19.   $(function() {  
  20.     $( "input[type=button], a, button" )  
  21.       .button()  
  22.       .click(function( event ) {  
  23.         event.preventDefault();  
  24.       });  
  25.   });  
  26.   </script>  
  27. </head>  
  28. <body>  
  29.    
  30. <button>new button </button>  
  31.    
  32. <input type="button" value="your button" />  
  33.    
  34.    
  35. </body>  
  36. </html>  
  37. </body>  
  38. </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中如图所示


最后修改代码:

  1. <%@ 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>
  2. 最后运行效果图如下

希望对大家有用

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值