爱易网
IT新闻
IT新闻
爱易资讯
网站搭建
云虚拟主机教程
云服务器教程
Apache教程
IIS教程
Nginx教程
网站策划
站长文章
推广教程
淘宝客教程
网页设计
HTML教程
XHTML教程
CSS教程
HTML5教程
CSS3教程
JavaSript基础
JQuery教程
Node.js教程
前端技术
Ajax教程
Js特效
Xml教程
平面设计
页面UI设计
photoshop教程
程序开发
AI人工智能
Asp教程
Php教程
Asp.Net教程
Net Core教程
C#教程
Java教程
Jsp教程
开发技术
微信小程序教程
Uniapp开发教程
微信公众号开发
Andriod教程
IOS教程
DOS教程
Python教程
Docker教程
Windows Container教程
数据库
MSSQL教程
MySQL教程
Redis教程
Access教程
Oracle教程
数据库教程
操作系统
Linux教程
Windows教程
MAC教程
Cisco教程
交换机教程
防火墙教程
搜索
爱易网页
JS特效
查找页面中的字符
查找页面中的字符
日期:2014-05-18 浏览次数:20252 次
欢迎光临爱易网网页脚本特效中心,点击运行按钮演示特效:
以下是程序代码
<html> <head> <title>爱易网网页特效演示,查找页面中的字符</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> </head> <body bgcolor="#FFFFFF"> <table bgcolor="#000000" cellspacing="1" width="500" align="center"> <tbody> <tr> <td bgcolor="#4775c3" align="center"><strong style="font-weight: 400"> <font color="#FFFFFF" face="宋体" style="font-size: 9pt">查找页面中的字符</font></strong></td> </tr> </tbody> </table> <table border="0" cellpadding="0" cellspacing="0" width="500" align="center"> <tr> <td align="left" valign="top" width="340"></td> <td align="left" valign="top" width="109"> <p align="center"> </td> <td align="left" valign="top" width="304"><font face="宋体" size="4" color="#FF0000"> </font></td> </tr> <tr> <td align="left" width="340" valign="top"><font face="宋体" color="#FF0000"> <span style="font-size: 9pt">在页面中实现搜索功能,类似Word等文本编辑软件里的搜索功能,只要是页面中的字符(别管是显在的还是隐蔽在文本框内部的),用这个都能找出来,从此,你的网页中又多了一个强大的不同寻常的工具。</span></font></td> <td align="left" width="109" valign="top"><font face="宋体" color="#FF0000"> </font></td> <td align="left" valign="top" width="304"> <span style="font-size: 9pt">你可以输入“脚本”一词查查看(共有三处) <script language="JavaScript"> var NS4 = (document.layers); // Which browser? var IE4 = (document.all); var win = window; // window to search. var n = 0; function findInPage(str) { var txt, i, found; if (str == "") return false; // Find next occurance of the given string on the page, wrap around to the // start of the page if necessary. if (NS4) { // Look for match starting at the current point. If not found, rewind // back to the first match. if (!win.find(str)) while(win.find(str, false, true)) n++; else n++; // If not found in either direction, give message. if (n == 0) alert("Not found."); } if (IE4) { txt = win.document.body.createTextRange(); // Find the nth match from the top of the page. for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) { txt.moveStart("character", 1); txt.moveEnd("textedit"); } // If found, mark it and scroll it into view. if (found) { txt.moveStart("character", -1); txt.findText(str); txt.select(); txt.scrollIntoView(); n++; } // Otherwise, start over at the top of the page and find first match. else { if (n > 0) { n = 0; findInPage(str); } // Not found anywhere, give message. else alert("Not found."); } } return false; } </script> </span> <form name="search" onSubmit="return findInPage(this.string.value);"> <p align="center"> <font size="3"><input name="string" type="text" size="15" onChange="n = 0;"></font> <input type="submit" value="Find"> </form> </td> </tr> </table> <div align="center"> <table width="500"> <tbody> <td width="492"> <div align="center"> <center> <table width="100%"> <tr> <td bgcolor="#3366CC" style="BORDER-BOTTOM: #817af3 1px solid; BORDER-LEFT-COLOR: #817af3; BORDER-LEFT-WIDTH: 1px; BORDER-RIGHT-COLOR: #817af3; BORDER-RIGHT-WIDTH: 1px; BORDER-TOP-COLOR: #817af3; BORDER-TOP-WIDTH: 1px" align="center"><font color="#FFFFFF" s
上一篇:狡猾的按钮特效
下一篇:各大搜索引擎网站综合搜索条
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
200美元英特尔Android笔记本行将到来
NoomWeight减肥
逆转猜想:如果阿里成为雅虎大股东会怎样?
谷歌新技术进入iOS平台:将叫板苹果Siri
传4G牌照国庆节前后发放 TD-LTE制式优先
一大波智能路由器正在袭来:小米、360、极路由大PK
MIUI,有了它小米就无惧对手
优酷土豆携手新浪微博 谋攻移动视频失地
“扫黄打非”下9158否认遭整顿
推荐阅读
更多>
探析APP移动营销发扬实效的微妙
三大运营商获通知大减营销费 传3年减400多亿
前苹果顾问批判iPhone命名:不应加S
苹果售后生态链乱象:供需失衡价钱不一
移动联通回应税率改革:短期内收入利润将大减
继续涨:微博IPO第二交易日 收盘大涨11.71%
快递企业征收“份子钱” 成全了谁 苦了谁?
互联网金融一周年:余额宝最接地气,比特币最作死
喜大普奔:2016年国内乘客有望在飞机上使用手机
清点:罗永浩推锤子ROM 小米打法遭模拟
Facebook财报前瞻:投资者仍信心不足
虚拟运营商前路迷茫 业界建议发力车联网
打车软件竞争白热化:有冷兵器时代意味
称产品遭诋毁 奇虎再诉百度
微软觊觎移动互联市场:手机未出渠道先行
英特尔涉嫌垄断 欧盟或开出史上最高罚单
从3G牌照发放看中国4G规划效果
用友软件股价逆势下跌 再融资方案现曙光
首家国有独资P2P平台上线 或预示政策日渐明朗
解读苹果收购Beats背后动机:库克在想什么?