jQuery-mobile-iscrollview 更改内容样式时不滚动显示:无显示:块或 jquery 显示和隐藏

Posted

技术标签:

【中文标题】jQuery-mobile-iscrollview 更改内容样式时不滚动显示:无显示:块或 jquery 显示和隐藏【英文标题】:jQuery-mobile-iscrollview not scrolling when changing contents style display:none to display:block OR jquery show and hide 【发布时间】:2013-05-12 11:47:31 【问题描述】:

我正在使用来自 :https://github.com/watusi/jquery-mobile-iscrollview 的 jQuery-mobile-iscrollview,但这在滚动视图内容下更改内容样式(显示:无到显示:块)时不起作用。

这是我的代码:

$(".collapse_btn").on('tap',function()
    $(this).siblings().toggle();
);

这是我的 html 代码:

<div class="collapsible_step_two">
 <div class="collapse_content_step_two">
  <div class="ui-grid-a">
   <div class="ui-block-a">
    <button data-role="none" class="collapsecontent_btn">Whats Included ?</button>
   </div>
   <div class="ui-block-b" style="text-align:right;">
    <button data-role="none" class="collapsecontent_btn">Information</button>
   </div>                
  </div>
 </div>
 <button data-role="none" class="collapse_btn"></button>
</div>                       

【问题讨论】:

尝试将显示更改为inline-block,使用.css('display', 'inline-block') 谢谢你.. Omar 的重播。我试过这个,但没有工作...... 你能显示你要显示/隐藏的内容的 html 代码吗? 嗨。奥马尔,你能检查一下我的 HTML 代码吗? 嗨奥马尔,我得到了解决方案:我的代码在这里:$(this).siblings().toggle().trigger("updatelayout"); 【参考方案1】:

最后我得到了这个解决方案:

$(this).siblings().toggle().trigger("updatelayout");

【讨论】:

哦..你节省了我很多时间:)

以上是关于jQuery-mobile-iscrollview 更改内容样式时不滚动显示:无显示:块或 jquery 显示和隐藏的主要内容,如果未能解决你的问题,请参考以下文章