两个div(一个带有tinymce)共享一个滚动条 [英] Two divs (one with tinymce) to share a scrollbar

查看:338
本文介绍了两个div(一个带有tinymce)共享一个滚动条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这两个div:

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

然后在JS中,将tinymce设置为"ingredients" div.如何使这两个div共享如下滚动条: http://jsfiddle.net/userdude/hThsx/

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/

推荐答案

问题在于,您的编辑器对自己的文档使用的是可内容编辑的iframe. 因此,此iframe具有自己的滚动条,除了将iframe尺寸调整为内部文档尺寸外,您无法对其进行任何操作.在这种情况下,编辑器iframe将没有滚动条.

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.

现在,您可以遵循Cobra_Fasts的想法,在两个div周围放置一个包装div,并使其具有滚动条.

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

这篇关于两个div(一个带有tinymce)共享一个滚动条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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