久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      jquery怎么修改z-index值

      jquery修改z-index值的方法:1、用css()方法,語法“$(selector).css("z-index","值")”;2、用attr()方法,語法“$(selector).attr("style","z-index:值")”。

      jquery怎么修改z-index值

      本教程操作環(huán)境:windows7系統(tǒng)、jquery1.10.2版本、Dell G3電腦。

      在jquery中,可以利用css()或attr()方法來修改元素的z-index值。

      • css() 方法可設(shè)置被選元素的一個或多個樣式屬性。

      • attr() 方法可設(shè)置被選元素的屬性值。

      示例:

      <!DOCTYPE html> <html> 	<head> 		<meta charset="utf-8" /> 		<style type="text/css"> 			img { 				position: absolute; 				left: 0px; 				top: 0px; 				z-index: -1; 			} 		</style> 		<script src="js/jquery-1.10.2.min.js"></script> 		<script type="text/javascript"> 			$(document).ready(function() { 				$("button").click(function() { 					// $("img").css("z-index","1"); 					$("img").attr("style","z-index:1;"); 				}); 			}); 		</script>  	</head>  	<body> 		<h1>This is a heading</h1> 		<img src="img/2.jpg" /> 		<p>由于圖像的 z-index 是 -1,因此它在文本的后面出現(xiàn)。</p><br /><br /><br /><br /><br /><br /> 		<button id="but1">改變z-index值,讓圖片在文字前</button>  	</body> </html>

      jquery怎么修改z-index值

      相關(guān)教程推薦:jQuery視頻教程

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號