jquery复习笔记1 - ready() show() hide() toggle()
2014-05-21 14:52
656 查看
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <base href="<%=basePath%>"> <title>My JSP 'index.jsp' starting page</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs /jquery/1.4.0/jquery.min.js"></script> <script type="text/javascript"> $(document).ready( function(){ $("#b1").click( function(){ $("p").hide(); } ); $("#b2").click( function(){ $("p").show(); } ); } ); </script> </head> <body> This is my JSP page. <br> <p>我将被隐藏掉</p> <button id="b1">隐藏</button> <button id="b2">显示</button> </body> </html>
心得:可在$(document).ready();方法中进行方法的绑定,比如给按钮绑定某些事件。
相关文章推荐
- JQuery学习笔记之JQuery效果hide、show以及toggle方法的callback参数
- jQuery笔记1 — hide、show、toggle、css、选择器
- jquery 显示隐藏div方法show(),hide(),toggle(),slideDown()总结
- Jquery基础之hide,show,toggle
- jquery 显示隐藏div方法show(),hide(),toggle(),slideDown()总结
- jquery 显示隐藏div方法show(),hide(),toggle(),slideDown()总结
- jquery中show()、hide()和toggle()用法实例
- jQuery动画效果(show与hide/toggle/slideUp/slideToggle/fadeIn/fadeTo)
- jQuery动画效果(show与hide/toggle/slideUp/slideToggle/fadeIn/fadeTo)
- 浅谈jQuery之show(),hide(),toggle(),slideToggle()用法及区别
- jQuery动画animate使用show hide toggle
- jQuery动画-让页面动起来! (2)基本的动画函数主要分为show, hide和toggle
- jQuery中.show()和.hide()和.click()和.toggle()事件
- 实例讲解Jquery中隐藏hide、显示show、切换toggle的用法
- jQuery-show()与html()及hide()用法 学习笔记四
- jquery中show()、hide()和toggle()用法实例
- JQuery 显示隐藏动画( show(),hide(),toggle() )
- jQuery-动画 animate() hide() show() toggle() fadeT0() slideToggle()
- Jquery的hide及toggle方法让超链接慢慢消失
- JQuery show hide方法