Jquery 基本操作
2011-10-26 10:25
549 查看
Launching Code onDocument Ready
Adding and Removing an HTML class
SpecialEffects
Callbackand Functions
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Jquery Tutorials</title> <script src="js/jquery-1.6.4.js" type="text/javascript"></script> <script type="text/javascript" language="javascript"> $(document).ready(function () { //alert("test"); $("a").click(function (event) { alert("Thank you for visiting"); // can prevent to redirect to google.com event.preventDefault(); }); }); </script> </head> <body> <a href="http://www.google.com">Google</a> </body> </html>
Adding and Removing an HTML class
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Jquery Tutorials</title> <style type="text/css"> a.test{font-weight:bold;} </style> <script src="js/jquery-1.6.4.js" type="text/javascript"></script> <script type="text/javascript" language="javascript"> $(document).ready(function () { // add the class $("a").addClass("test"); // remove the class //$("a").removeClass("test"); }); </script> </head> <body> <a href="http://www.google.com">Google</a> </body> </html>
SpecialEffects
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Jquery Tutorials</title> <script src="js/jquery-1.6.4.js" type="text/javascript"></script> <script type="text/javascript" language="javascript"> $(document).ready(function () { //alert("test"); $("a").click(function (event) { event.preventDefault(); // slowly disappear $(this).hide("slow"); }); }); </script> </head> <body> <a href="http://www.google.com">Google</a> </body> </html>
Callbackand Functions
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Jquery Tutorials</title> <script src="js/jquery-1.6.4.js" type="text/javascript"></script> <script type="text/javascript" language="javascript"> $(document).ready(function () { // fetch the requested HTML snippet $.get('SpecialEffects.htm', function (data) { //$('.result').html(data); alert(data); }); }); </script> </head> <body> <a href="http://www.google.com">Google</a> </body> </html>
相关文章推荐
- Ajax/jQuery 各项基本操作
- Web基础(5)jQuery,基本操作及代码案例
- jQuery中实现动画效果的基本操作介绍
- jQuery学习笔记(七)JS 一些基本操作代码整理
- JQuery 基本操作2
- JQuery基本操作
- jQuery基本操作
- Jquery操作基本筛选过滤器
- Jquery Table 的基本操作
- 轻松学习jQuery插件EasyUI EasyUI实现树形网络基本操作(2)
- jQuery表格(Table)基本操作实例分析
- JQuery 基本操作2
- jQuery 對table的基本操作
- JQuery 操作基本控件
- Jquery表单取值赋值的一些基本操作
- jquery 操作DOM的基本用法
- jQuery中对select下拉框的基本操作
- jquery基本操作
- jquery基本操作