Php Jquery mobile-div内容绑定滚动条第一次不工作,但在刷新页面后工作 $(文档).ready(函数(){ $('#content').bind('scroll',function(){ 警报(0); }); });
在这方面,我已经设置了一个警告滚动,但它不工作,但它的工作后,手动刷新页面 不知道原因是什么?任何帮助Php Jquery mobile-div内容绑定滚动条第一次不工作,但在刷新页面后工作 $(文档).ready(函数(){ $('#content').bind('scroll',function(){ 警报(0); }); });,php,jquery-mobile,Php,Jquery Mobile,在这方面,我已经设置了一个警告滚动,但它不工作,但它的工作后,手动刷新页面 不知道原因是什么?任何帮助 PS:div的CSS属性position是“绝对的”-这与上述问题有关吗?您的问题在其他地方,下面的jsiddle可以正常工作 $(文档).ready(函数(){ $('#content').bind('scroll',function(){ console.log(“在这里”); }); }); 这里有很多内容。。。这里还有很多 谢谢您的回复。我发现了问题,并通过将$('#conten
PS:div的CSS属性position是“绝对的”-这与上述问题有关吗?您的问题在其他地方,下面的jsiddle可以正常工作
$(文档).ready(函数(){
$('#content').bind('scroll',function(){
console.log(“在这里”);
});
});
这里有很多内容。。。这里还有很多
谢谢您的回复。我发现了问题,并通过将$('#content').bind('scroll',function()
更改为$('div:jqmData(role=“content”)).bind('scroll',function()
)进行了修复。
<div data-role="page" id="one" data-theme="a" >
<div data-role="content" id="content">
<script type="text/javascript" >
$(document).ready(function() {
$('#content').bind('scroll', function () {
alert(0);
});
});
<div data-role="page" id="one" data-theme="a" >
<div data-role="content" id="content">
<script type="text/javascript" >
$(document).ready(function() {
$('#content').bind('scroll', function () {
console.log("Here it is");
});
});
</script>
Here is a lot of content... a lot more goes here
</div>
</div>