可否做出页面同步源码功能?
Not logged in

可否做出页面同步源码功能?

(1) By allenzhang (allen) on 2020-02-19 05:04:10 [link] [source]

我希望左边预览区浏览,右边代码区可以同步滚动。我尝试了一些js方法都不成功。可否实现?

(2.1) By tinus on 2020-02-19 06:35:04 edited from 2.0 in reply to 1 [source]

As I don't read Chinese, I'll be responding in English. (Translation courtesy of Google Translate)

Can I make a page sync source function?

I hope that the preview area on the left can be browsed, and the code area on the right can be scrolled synchronously. I tried some js methods without success. Can it be achieved?

I wouldn't know how to achieve this.

I've tried it, but it requires a mapping to be made between the source (HTML) code and the preview; and Internet Explorer's HTML parser (which the plugin uses) doesn't appear to provide this: an HTML element doesn't have a 'source position' property or anything.

(Edit: here's Google Translate's translation back to Chinese):

我不知道该怎么实现。

我已经尝试过了,但是它要求在源(HTML)代码和预览之间进行映射。 Internet Explorer的HTML解析器(该插件使用)似乎没有提供此功能:HTML元素没有“源位置”属性或任何其他内容。