亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

JQuery測試代碼集

系統(tǒng) 2144 0
版權(quán)聲明:原創(chuàng)作品,允許轉(zhuǎn)載,轉(zhuǎn)載時請務必以超鏈接形式標明文章原始出版、作者信息和本聲明。否則將追究法律責任。 http://blog.csdn.net/mayongzhan - 馬永占,myz,mayongzhan

JQuery 網(wǎng)上搜到的幾個教程 , 編寫的測試代碼集合 . 別忘了去下載 jquery.js 這個文件 ...

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

<!----------------------menu.html------------------------->

test1_1.html 未使用 ajax 的切換

test1_2.html 使用 ajax 的切換

test2.html 簡單插入

test3.html 加載

test4.html 交替顏色和鼠標 overout 變顏色

test5.html window.status

test6.html 圖片疊加 || ball.jpg,corner_bl.gif,shadow.gif,shadow180.gif

test7.html DOM 外包一層

test8.html 結(jié)合 php, 做按鈕點后隨即產(chǎn)生 || script.php

<!------------------------test1_1.html----------------------->

<!-- 未使用 ajax 的切換 -->

<script language="javascript">

function test() {

var external_links = document.getElementById('external_links');

var links = external_links.getElementsByTagName('a');

for (var i=0;i < links.length;i++) {

var link = links.item(i);

link.onclick = function() {

return confirm('You are going to visit: ' + this.href);

};

}

}

</script>

<html>

<head>

<meta http-equiv="Content-Language" content="utf-8" />

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>title</title>

</head>

<body onload="javascript:test();">

<div id="external_links">

<a href="test1_1.html#1">a</a>

<a href="test1_1.html#2">b</a>

<a href="test1_1.html#3">c</a>

<a href="test1_1.html#4">d</a>

</div>

</body>

</html>

<!------------------------ test1_2.html ----------------------->

<!-- 使用 ajax 的切換 -->

<script type="text/javascript" src=""></script>

<script type="text/javascript" src="jquery-<?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /><chsdate w:st="on" isrocdate="False" islunardate="False" day="30" month="12" year="1899">1.2.1</chsdate>.js"></script>

<script type="text/javascript">

function test() {

$('#external_links a').click(function() {

return confirm('You are going to visit: ' + this.href);

});

}

</script>

<!DOCTYPE html PUBLIC "-//W<chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="3" unitname="C">3C</chmetcnv>//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>

<meta http-equiv="Content-Language" content="utf-8" />

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link href="" rel="stylesheet" type="text/css" />

<title></title>

</head>

<body onload="javascript:test();">

<div id="external_links">

<a href="test1_2.html#1">e</a>

<a href="test1_2.html#2">f</a>

<a href="test1_2.html#3">g</a>

<a href="test1_2.html#4">h</a>

</div>

</body>

</html>

<!----------------------test2.html------------------------->

<!-- 簡單插入 -->

<script type="text/javascript" src="jquery-<chsdate w:st="on" isrocdate="False" islunardate="False" day="30" month="12" year="1899">1.2.1</chsdate>.js"></script>

<script type="text/javascript">

function test() {

$('<p></p>')

.html('Hey World!')

.css('background', 'yellow')

.appendTo("body");

}

</script>

<!DOCTYPE html PUBLIC "-//W<chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="3" unitname="C">3C</chmetcnv>//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>

<meta http-equiv="Content-Language" content="utf-8" />

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link href="" rel="stylesheet" type="text/css" />

<title></title>

</head>

<body onload="javascript:test();">

</body>

</html>

<!----------------------test3.html------------------------->

<!-- 加載 -->

<script type="text/javascript" src="jquery-<chsdate w:st="on" isrocdate="False" islunardate="False" day="30" month="12" year="1899">1.2.1</chsdate>.js"></script>

<script type="text/javascript">

$(document).ready(function(){

alert("Congratluations!");

});

</script>

<script type="text/javascript" src=""></script>

<!DOCTYPE html PUBLIC "-//W<chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="3" unitname="C">3C</chmetcnv>//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>

<meta http-equiv="Content-Language" content="utf-8" />

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link href="" rel="stylesheet" type="text/css" />

<title></title>

</head>

<body>

</body>

</html>

<!-----------------------test4.html------------------------>

<!-- 交替顏色和鼠標 overout 變顏色 -->

<script type="text/javascript" src="jquery-<chsdate w:st="on" isrocdate="False" islunardate="False" day="30" month="12" year="1899">1.2.1</chsdate>.js"></script>

<!DOCTYPE html PUBLIC "-//W<chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="3" unitname="C">3C</chmetcnv>//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>

<meta http-equiv="Content-Language" content="utf-8" />

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<meta name="author" content=" 馬永占 (MyZ)" />

<meta name="Copyright" content=" 馬永占 (MyZ)" />

<meta name="descrīption" content="" />

<meta name="keywords"content="" />

<link rel="icon" href="" type="image/x-icon" />

<link rel="shortcut icon" href="" type="image/x-icon" />

<link href="" rel="stylesheet" type="text/css" />

<title></title>

<script type="text/javascript">

$(document).ready(function(){ // 這個就是傳說的 ready

$(".stripe tr").mouseover(function(){

// 如果鼠標移到 class stripe 的表格的 tr 上時,執(zhí)行函數(shù)

$(this).addClass("over");}).mouseout(function(){

// 給這行添加 class 值為 over ,并且當鼠標一出該行時執(zhí)行函數(shù)

$(this).removeClass("over");}) // 移除該行的 class

$(".stripe tr:even").addClass("alt");

// class stripe 的表格的偶數(shù)行添加 class 值為 alt

});

</script>

<style>

th {

background:#0066FF;

color:#FFFFFF;

line-height:20px;

height:30px;

}

td {

padding:6px 11px;

border-bottom:1px solid #95bce2;

vertical-align:top;

text-align:center;

}

td * {

padding:6px 11px;

}

tr.alt td {

background:#ecf6fc; /* 這行將給所有的 tr 加上背景色 */

}

tr.over td {

background:#bcd4ec; /* 這個將是鼠標高亮行的背景色 */

}

</style>

</head>

<body>

<table class="stripe" width="50%" border="0" cellspacing="0" cellpadding="0">

<!-- class="stripe" 來標識需要使用該效果的表格 -->

<thead>

<tr>

<th> 姓名 </th>

<th> 年齡 </th>

<th>QQ</th>

<th>Email</th>

</tr>

</thead>

<tbody>

<tr>

<td>MyZ</td>

<td>20</td>

<td>10000</td>

<td>10000@qq.com</td>

</tr>

<tr>

<td>MyZ</td>

<td>20</td>

<td>10000</td>

<td>10000@qq.com</td>

</tr>

<tr>

<td>MyZ</td>

<td>20</td>

<td>10000</td>

<td>10000@qq.com</td>

</tr>

<tr>

<td>MyZ</td>

<td>20</td>

<td>10000</td>

<td>10000@qq.com</td>

</tr>

<tr>

<td>MyZ</td>

<td>20</td>

<td>10000</td>

<td>10000@qq.com</td>

</tr>

</tbody>

</table>

</body>

</html>

<!----------------------test5.html------------------------->

<!-- window.status -->

<script type="text/javascript" src="jquery-<chsdate w:st="on" isrocdate="False" islunardate="False" day="30" month="12" year="1899">1.2.1</chsdate>.js"></script>

<script type="text/javascript">

$(document).ready(function(){

$('a.affLink').mouseover(function(){window.status=" 特別的 status";return true;})

.mouseout(function(){window.status='Done';return true;});

});

</script>

<!DOCTYPE html PUBLIC "-//W<chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="3" unitname="C">3C</chmetcnv>//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>

<meta http-equiv="Content-Language" content="utf-8" />

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<meta name="author" content=" 馬永占 (MyZ)" />

<meta name="Copyright" content=" 馬永占 (MyZ)" />

<meta name="descrīption" content="" />

<meta name="keywords"content="" />

<link rel="icon" href="" type="image/x-icon" />

<link rel="shortcut icon" href="" type="image/x-icon" />

<link href="" rel="stylesheet" type="text/css" />

<title></title>

<style type="text/css">

<!--

-->

</style>

</head>

<body>

<a href="test5.html#a" class="affLink">aaa</a>

<a href="test5.html#b" class="affLink">bbb</a>

<a href="test5.html#c" class="affLink">ccc</a>

</body>

</html>

<!-----------------------test6.html------------------------>

<!-- 圖片疊加 -->

<script type="text/javascript" src="jquery-<chsdate w:st="on" isrocdate="False" islunardate="False" day="30" month="12" year="1899">1.2.1</chsdate>.js"></script>

<script language="JavaScript" type="text/javascript">

$(document).ready(function(){

$("img.dropshadow")

.wrap("<div class='wrap0'><div class='wrap1'><div class='wrap2'>" +

"<div class='wrap3'></div></div></div></div>");

});

</script>

<!DOCTYPE html PUBLIC "-//W<chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="3" unitname="C">3C</chmetcnv>//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>

<meta http-equiv="Content-Language" content="utf-8" />

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<meta name="author" content=" 馬永占 (MyZ)" />

<meta name="Copyright" content=" 馬永占 (MyZ)" />

<meta name="descrīption" content="" />

<meta name="keywords"content="" />

<link rel="icon" href="" type="image/x-icon" />

<link rel="shortcut icon" href="" type="image/x-icon" />

<link href="" rel="stylesheet" type="text/css" />

<title></title>

<style type="text/css">

.wrap0, .wrap1, .wrap2, .wrap3 {

display:inline-table;

/* \*/display:block;/**/

}

.wrap0 {

float:left;

background:url(shadow.gif) right bottom no-repeat;

}

.wrap1 {

background:url(shadow180.gif) no-repeat;

}

.wrap2 {

background:url(corner_bl.gif) -18px 100% no-repeat;

}

.wrap3 {

padding:10px 14px 14px 10px;

background:url(corner_tr.gif) 100% -18px no-repeat;

}

body { background: #fff;}

</style>

</head>

<body>

<p>First, the old-school, multiple divs hard coded into the html</p>

<div class="wrap0">

<div class="wrap1">

<div class="wrap2">

<div class="wrap3">

<img

src="ball.jpg"

alt="The object casting a shadow"

/>

</div>

</div>

</div>

分享到:
評論

JQuery測試代碼集


更多文章、技術(shù)交流、商務合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯(lián)系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦?。。?/p>

發(fā)表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 久久久噜久噜久久gif动图 | 麻豆亚洲| 亚洲一级黄色 | 豆国产97在线 | 中国 | 雅虎日本免费一区二区三区 | 日本一级欧美一级中文 | 日韩欧美一二三 | 日韩在线a视频免费播放 | 色狠狠婷婷97 | 亚洲精品不卡午夜精品 | 狠狠操夜夜爱 | 日本伊人 | 26uuu欧美日本| 久久成人动漫 | 伊人久久精品亚洲精品一区 | 成人短视频在线在线观看 | 久久在线视频免费观看 | 亚洲无线码一区在线观看 | 狠狠干中文字幕 | 欧美日韩一区二区在线观看 | 国产精品偷伦视频免费观看的 | 96精品国产高清在线看入口 | 91久久国产综合精品女同国语 | 成人欧美一区二区三区 | 日韩亚洲欧美一区二区三区 | 狠狠色噜噜狠狠狠狠98 | 精品欧美高清一区二区免费 | 欧美日一级片 | 天天操天天干天天玩 | 在线观看日本免费视频大片一区 | 亚洲高清资源在线观看 | 国产欧美国产精品第一区 | 亚洲综合一区二区精品久久 | 欧美黄网站 | 国产视频一区在线观看 | 888午夜不卡理论久久 | 欧美视频第二页 | 极品俄罗斯性孕妇孕交 | 99视频在线免费看 | 奇米777四色影视在线看 | 国产日韩美国成人 |