js制作的鼠標懸浮時產(chǎn)生的下拉框效果
更新時間:2012年10月27日 23:28:54 作者:
js制作的鼠標懸浮時產(chǎn)生的下拉框效果,需要的朋友可以參考下
先給大家補補課,講個簡單的例子:
<html><head>
<meta type-equiv="Content-Type" content="text/html">
<meta charset="utf-8″>
<script type="text/javascript">
jq=jQuery.noConflict();
jq=(document).ready(function(){
jq("a").mouseover(function(){
jq("a").css("color","#c00″);
});
jq("a').mouseout(function(){
jq("a").css("color","#000000″);
});
</script>
</head><body>
<a href="www.dbjr.com.cn">鼠標放在上面看看會發(fā)生什么</a>
</body></html>
jq=jQuery.noConflict();
這是定義一個js的jquery庫名;
jq(document).ready(function(){
/*這是一個關(guān)于document對象的函數(shù)里面是函數(shù)內(nèi)容*/
});
jq("a").mouseover()function(){
/*這是定義事件mouseover的內(nèi)容*/
}。
在看一個實際例子;點擊時隱藏文本:
<html><head>
<script type="text/javascript">
$(document).ready(function() {
$(".abc .hide").click(function() {
$("this").parents("abc").hide("slow"); }); });
</script>
<stype type="text/css">
div.abc {
background: #e5eec;
padding: 7px;
margin: 0px;
border: solid 1px #c00; }
</stype>
</head><body>
<div class="abc">
<p><button class="abc" type="button">hide<button><br/>
這段文字將被隱藏<br/>
這段文字也將被隱藏
</p></div>
<div class="abc"><p>
<button class="abc" type="button">hide me</button><br/>
這段文字在點擊hideme時隱藏<br/>
這段文字同樣也會隱藏。
</p></dvi>
</body></html>
功課差不多了,我們言歸正傳回到主題下拉框才是王道。
<html><head>
<!–author linuxa
blogs: www.dbjr.com.cn–>
<meta http-equiv="content-type" content="text/html">
<meta charset="utf-8″>
<title>下拉框的制作</title>
</head><body>
</body></html>
復(fù)制代碼 代碼如下:
<html><head>
<meta type-equiv="Content-Type" content="text/html">
<meta charset="utf-8″>
<script type="text/javascript">
jq=jQuery.noConflict();
jq=(document).ready(function(){
jq("a").mouseover(function(){
jq("a").css("color","#c00″);
});
jq("a').mouseout(function(){
jq("a").css("color","#000000″);
});
</script>
</head><body>
<a href="www.dbjr.com.cn">鼠標放在上面看看會發(fā)生什么</a>
</body></html>
jq=jQuery.noConflict();
這是定義一個js的jquery庫名;
jq(document).ready(function(){
/*這是一個關(guān)于document對象的函數(shù)里面是函數(shù)內(nèi)容*/
});
jq("a").mouseover()function(){
/*這是定義事件mouseover的內(nèi)容*/
}。
在看一個實際例子;點擊時隱藏文本:
復(fù)制代碼 代碼如下:
<html><head>
<script type="text/javascript">
$(document).ready(function() {
$(".abc .hide").click(function() {
$("this").parents("abc").hide("slow"); }); });
</script>
<stype type="text/css">
div.abc {
background: #e5eec;
padding: 7px;
margin: 0px;
border: solid 1px #c00; }
</stype>
</head><body>
<div class="abc">
<p><button class="abc" type="button">hide<button><br/>
這段文字將被隱藏<br/>
這段文字也將被隱藏
</p></div>
<div class="abc"><p>
<button class="abc" type="button">hide me</button><br/>
這段文字在點擊hideme時隱藏<br/>
這段文字同樣也會隱藏。
</p></dvi>
</body></html>
功課差不多了,我們言歸正傳回到主題下拉框才是王道。
復(fù)制代碼 代碼如下:
<html><head>
<!–author linuxa
blogs: www.dbjr.com.cn–>
<meta http-equiv="content-type" content="text/html">
<meta charset="utf-8″>
<title>下拉框的制作</title>
</head><body>
</body></html>
相關(guān)文章
jQuery實現(xiàn)ajax調(diào)用WCF服務(wù)的方法(附帶demo下載)
這篇文章主要介紹了jQuery實現(xiàn)ajax調(diào)用WCF服務(wù)的方法,以完整實例形式分析了jQuery的ajax前端調(diào)用及后臺交互調(diào)用WCF服務(wù)的相關(guān)技巧,并附帶完整實例共讀者下載,需要的朋友可以參考下2015-12-12jquery.validate自定義驗證用法實例分析【成功提示與擇要提示】
這篇文章主要介紹了jquery.validate自定義驗證用法,結(jié)合實例形式分析了jQuery成功提示與擇要提示驗證操作相關(guān)實現(xiàn)與使用技巧,需要的朋友可以參考下2020-06-06jquery api參考 visualjquery 中國線路 速度快
jquery api參考 visualjquery 中國線路 速度快...2007-11-11jquery+ajax+C#實現(xiàn)無刷新操作數(shù)據(jù)庫數(shù)據(jù)的簡單實例
本篇文章主要是對jquery+ajax+C#實現(xiàn)無刷新操作數(shù)據(jù)庫數(shù)據(jù)的簡單實例進行了介紹,需要的朋友可以過來參考下,希望對大家有所幫助2014-02-02JSON中key動態(tài)設(shè)置及JSON.parse和JSON.stringify()的區(qū)別
這篇文章主要介紹了JSON中key動態(tài)設(shè)置及JSON.parse和JSON.stringify()的區(qū)別講解,非常不錯,具有參考借鑒價值,需要的朋友參考下2016-12-12jQuery頁面元素動態(tài)添加后綁定事件丟失方法,非 live
這篇文章主要介紹了jQuery頁面元素動態(tài)添加后綁定事件丟失方法,非 live 的相關(guān)資料,非常不錯,具有參考借鑒價值,感興趣的朋友一起學(xué)習(xí)吧2016-06-06