<div style="display:none;">
    <div id="wmd-editor" class="wmd-panel">
        <div id="wmd-button-bar"></div>
        <textarea id="wmd-input"></textarea>
    </div>
    <div id="wmd-preview" class="wmd-panel"></div>
    <div id="wmd-output" class="wmd-panel"></div>
</div>

看到,我正在跟踪derobins-wmd的wmd-test.html,除了将这些东西放在隐藏的div中。
uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMNSHTMLTextAreaElement.selectionStart]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: http://localhost/derobins-wmd-980f687/wmd.js :: anonymous :: line 490" data: no]
uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMNSHTMLTextAreaElement.selectionStart]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: http://localhost/derobins-wmd-980f687/wmd.js :: anonymous :: line 490" data: no]

最佳答案

如果插件不喜欢没有高度/宽度的元素,则可以使用左偏技术。

<div style="position: absolute; left: -1000px; width: 100px">

10-07 21:18