滚动到水平div中的元素 [英] scroll to element in horizontal div

查看:100
本文介绍了滚动到水平div中的元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个水平div:

我需要通过JavaScript按钮滚动到此div中的特定元素(必须将click div滚动到该元素之后)。我该怎么做?

i need to scroll to the specific element in this div via JavaScript button (after the click div must be scrolled to that element). How can I do this?

<div class="group" id="frames">
<div class="item frames-item">
<img src="1.jpg">
</div>
<div class="item frames-item">    
<img src="2.jpg">
</div>
....
....
</div>


推荐答案

$。scrollTo 是你的朋友:

$(container).scrollTo(target)

这篇关于滚动到水平div中的元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆