最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
试试看这个,可能和你的要求不一样,但是可是实现一样的功能
时间:2022-06-30 09:42:53 编辑:袖梨 来源:一聚教程网
function findInPage(str) {
var txt, i, found;
if (str == "")
return false;
if (NS4) {
if (!win.find(str))
while(win.find(str, false, true))
n++;
else
n++;
if (n == 0)
alert("没发现你要找的!");
}
if (IE4) {
txt = win.document.body.createTextRange();
for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) {
txt.moveStart("character", 1);
txt.moveEnd("textedit");
}
if (found) {
txt.moveStart("character", -1);
txt.findText(str);
txt.select();
txt.scrollIntoView();
n++;
}
else {
if (n > 0) {
n = 0;
findInPage(str);
}
else
alert("没发现你要找的!");
}
}
return false;
}
var txt, i, found;
if (str == "")
return false;
if (NS4) {
if (!win.find(str))
while(win.find(str, false, true))
n++;
else
n++;
if (n == 0)
alert("没发现你要找的!");
}
if (IE4) {
txt = win.document.body.createTextRange();
for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) {
txt.moveStart("character", 1);
txt.moveEnd("textedit");
}
if (found) {
txt.moveStart("character", -1);
txt.findText(str);
txt.select();
txt.scrollIntoView();
n++;
}
else {
if (n > 0) {
n = 0;
findInPage(str);
}
else
alert("没发现你要找的!");
}
}
return false;
}
相关文章
- 粒粒的小人国什么时候开服 粒粒的小人国开服时间 12-16
- 三角洲新赛季更新时间 三角洲行动新赛季时长介绍 12-16
- 保卫向日葵怎么获得奥术 奥术获取途径全面汇总 12-16
- 保卫向日葵怎么快速消耗体力 体力快速消耗实用方法介绍 12-16
- 保卫向日葵怎么开启圣物栏 圣物栏解锁方法与扩容技巧 12-16
- 保卫向日葵怎么添加好友 好友添加实用方法汇总 12-16