如何将jquery model()滚动到特定的元素ID [英] How to scroll jquery model() to specific element ID

查看:96
本文介绍了如何将jquery model()滚动到特定的元素ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

i am using j query model('show') for pop up 

in pop up i need to scroll bar to specific elem id 

currently happening for page scroll but scroll is not happening for pop up box
i tried following scenarios
both are not working





我的尝试:



1)。 $('。model-content')。animate({



scrollTop:$(#model_idX)。offset()。top



},2000);







这里model_idX是dynomic ID

divmodel-content将出现在POpUP



现在我想在弹出窗口(不是页面)中滚动到特定ID

说model-id6





我的HTML PAGE看起来像beow





< html>

< body>



What I have tried:

1) . $('.model-content').animate({

scrollTop: $("#model_idX").offset().top

}, 2000);



here model_idX is dynomic ID
div " model-content" will appear in POpUP

now i want to scroll within popup(not in page) to specific ID
say model-id6


my HTML PAGE something looks like beow


<html>
<body>


























< / body>

< html>



</body>
<html>

推荐答案

('。model -content')。animate({



scrollTop:
('.model-content').animate({

scrollTop:


(#model_idX)。offset()。top



},2000);







这里model_idX是dynomic ID

divmodel-content将出现在POpUP



现在我想在弹出窗口(不在页面中)内滚动到特定ID

say model-id6





我的HTML PAGE看起来像beow





< html>

< body>

("#model_idX").offset().top

}, 2000);



here model_idX is dynomic ID
div " model-content" will appear in POpUP

now i want to scroll within popup(not in page) to specific ID
say model-id6


my HTML PAGE something looks like beow


<html>
<body>

























< / body>

< html>



</body>
<html>


这篇关于如何将jquery model()滚动到特定的元素ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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