首页 >

jquery怎么修改滚动条位置

web前端|前端问答jquery怎么修改滚动条位置
jquery
web前端-前端问答
折叠侧栏源码带后台,ubuntu如何找网卡,查看服务器上tomcat,powerbi网络爬虫案例,闭包函数的作用php,丰泽区seo优化lzw
jquery提供了两种方法可直接修改滚动条位置
管理系统模源码,在ubuntu安装c,网络爬虫工具 英文,moder php,seo网站图片lzw
scrollLeft()
jtopcms源码无法安装,b250 ubuntu,tomcat服务器好慢,爬虫转义字符,php需要学习多久技术,求助seolzw
scrollTop()

1、使用scrollLeft()

scrollLeft() 可以设置匹配元素相对滚动条左侧的偏移,即水平滚动条的位置。

滚动条的水平位置指的是从其左侧滚动过的像素数。当滚动条位于最左侧时,位置是 0。

示例:

										$(document).ready(function() {				$("button").click(function() {					$("div").scrollLeft(100);				});			});						
The longest word in the english dictionary is: pneumonoultramicroscopicsilicovolcanoconiosis.

jquery怎么修改滚动条位置

2、使用scrollTop()

scrollTop()可设置匹配元素相对滚动条顶部的偏移,即垂直滚动条的位置。

示例:

										$(document).ready(function() {				$("button").click(function() {					$("div").scrollTop(100);				});			});						
This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.

jquery怎么修改滚动条位置

【推荐学习:jQuery视频教学、web前端视频】


  • 暂无相关文章
  • Posted in 未分类