Two divs (one with tinymce) to share a scrollbar

纵然是瞬间 提交于 2019-12-13 18:25:36

问题


I have these two divs:

<div id="ing" style="position:relative;">
     <div id="comm" style="position: absolute; width: 27% !important; height: 141px; right: 18px; top: 1px; ">
     </div>
</div>

And then in JS I set tinymce to the "ingredients" div. How to make these two divs share a scrollbar like this: http://jsfiddle.net/userdude/hThsx/


回答1:


Problem her is that your editor uses a contenteditable iframe with an own document. So this iframe has an own scrollbar and you cannot do anything about it except adjusting the iframe dimensions to the inner documents dimensions. In this case there won't be a scrollbar for the editor iframe.

Now you may follow Cobra_Fasts idea of putting a wrapper div around your two divs and let it have a scrollbar.



来源:https://stackoverflow.com/questions/11881262/two-divs-one-with-tinymce-to-share-a-scrollbar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!