js制作的鼠標(biāo)懸浮時產(chǎn)生的下拉框效果
更新時間:2012年10月27日 23:28:54 作者:
js制作的鼠標(biāo)懸浮時產(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="m.fzitv.net">鼠標(biāo)放在上面看看會發(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: m.fzitv.net–>
<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="m.fzitv.net">鼠標(biāo)放在上面看看會發(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: m.fzitv.net–>
<meta http-equiv="content-type" content="text/html">
<meta charset="utf-8″>
<title>下拉框的制作</title>
</head><body>
</body></html>
您可能感興趣的文章:
相關(guān)文章
jQuery動態(tài)追加頁面數(shù)據(jù)以及事件委托詳解
這篇文章主要為大家詳細介紹了jQuery動態(tài)追加頁面數(shù)據(jù)以及事件委托的相關(guān)資料,具有一定的參考價值,感興趣的小伙伴們可以參考一下2017-05-05
jQuery+Ajax+PHP+Mysql實現(xiàn)分頁顯示數(shù)據(jù)實例講解
這是一個典型的Ajax應(yīng)用,在頁面上,您只需要點擊“下一頁”,數(shù)據(jù)區(qū)將自動加載對應(yīng)頁碼的數(shù)據(jù),重新刷新數(shù)據(jù)區(qū)。類似的效果在很多網(wǎng)站上應(yīng)用,尤其在一些需要展示大量圖片數(shù)據(jù)的網(wǎng)頁如淘寶商品列表頁,Ajax分頁效果讓您的網(wǎng)站數(shù)據(jù)加載顯得非常流暢。2015-09-09
javascript 自定義回調(diào)函數(shù)示例代碼
使用函數(shù)做參數(shù)就有下面的好處:當(dāng)你a(b)的時候函數(shù)b就成了回調(diào)函數(shù),而你還可以a(c)這個時候,函數(shù)c就成了回調(diào)函數(shù)2014-09-09
jQuery實現(xiàn)下拉框左右移動(全部移動,已選移動)
本文主要介紹jQuery中利用appendTo()方法追加元素已實現(xiàn)左右移動的功能,希望對大家有所幫助。2016-04-04

