如何将jquery model()滚动到特定的元素ID [英] How to scroll jquery model() to specific element 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屋!