html中的网页前面的点,HTML链接到网页中的某个点 - 轻微扭曲

由于您无法修改该文件,因此唯一的方法是将其包装在或中,并驱动从相邻/包含页面中的JavaScript进行搜索和滚动。

function go() {

// "line" is the for which line to jump to; see the HTML.

var line = document.getElementById('line').value;

if (document.body.createTextRange) { // This is IE

var range = frames['log'].document.body.createTextRange();

if (range.findText(line)) {

range.select(); // Scroll the match into view and highlight it.

}

} else { // Non-IE. Tested in Firefox; YMMV on other browsers.

frames['log'].find(line); // Scroll the match into view and highlight it.

}

}

Go

网上试试我测试过,在IE7和FF3;如果它没有编辑地在别处工作,我会感到惊讶,但你永远不知道你的运气!

显然在你的情况下,你会以编程方式驱动滚动而不是通过框,但你可以看到它如何为你工作。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值