最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

.scrollLeft()

Contents:

.scrollLeft() 返回: Integer

描述: 為匹配的元素集合中獲取第一個(gè)元素的滾動(dòng)條的水平位置。

  • version added: 1.2.6.scrollLeft()

水平滾動(dòng)位置是和像素值以上所隱藏的滾動(dòng)區(qū)相同的。(The horizontal scroll position is the same as the number of pixels that are hidden from view above the scrollable area.)如果滾動(dòng)條是在非常左邊,或者這個(gè)元素沒(méi)有可滾動(dòng)的,那么這個(gè)數(shù)字是0。

例子:

獲取段落的scrollLeft。

<!DOCTYPE html>
<html>
<head>
  <style>
    p { margin:10px;padding:5px;border:2px solid #666; }
    </style>
  <script src="http://code.jquery.com/jquery-latest.min.js"></script>
</head>
<body>
  <p>Hello</p><p></p>
<script>var p = $("p:first");
			$("p:last").text( "scrollLeft:" + p.scrollLeft() );

			</script>

</body>
</html>

Demo:

.scrollLeft( value ) 返回: jQuery

描述 為匹配的元素集合中每個(gè)元素設(shè)置滾動(dòng)條的水平位置。

  • version added: 1.2.6.scrollLeft( value )

    value一個(gè)用來(lái)設(shè)置滾動(dòng)條水平位置的正整數(shù)。

水平滾動(dòng)位置是和像素值以上所隱藏的滾動(dòng)區(qū)相同的。(The horizontal scroll position is the same as the number of pixels that are hidden from view above the scrollable area.) scrollLeft為每個(gè)匹配元素設(shè)置滾動(dòng)條的水平位置。

Example:

設(shè)置一個(gè)div的scrollLeft。

<!DOCTYPE html>
<html>
<head>
  <style>
  div.demo {
  background:#CCCCCC none repeat scroll 0 0;
  border:3px solid #666666;
  margin:5px;
  padding:5px;
  position:relative;
  width:200px;
  height:100px;
  overflow:auto;
  }
  p { margin:10px;padding:5px;border:2px solid #666;width:1000px;height:1000px; }
	</style>
  <script src="http://code.jquery.com/jquery-latest.min.js"></script>
</head>
<body>
  <div class="demo"><h1>lalala</h1><p>Hello</p></div>
<script>$("div.demo").scrollLeft(300);
</script>

</body>
</html>

Demo:

jQuery 1.6 API 中文版腳本之家整理、修訂 (2011年6月)
浦江县| 山东省| 永康市| 政和县| 陕西省| 军事| 洪洞县| 龙山县| 赤壁市| 吉安县| 浦江县| 海城市| 西宁市| 白水县| 竹溪县| 吉林市| 中卫市| 修文县| 定远县| 泸水县| 巴彦淖尔市| 潞西市| 东辽县| 枝江市| 延长县| 准格尔旗| 凤城市| 灵山县| 通渭县| 确山县| 丽江市| 商南县| 通道| 石狮市| 德阳市| 和田市| 高雄市| 北京市| 宁武县| 和龙市| 依安县|