& lttitle & gt測" />
& lthead & gt
& ltmeta " & gt
& ltmeta http-equiv = " Content-Type " Content = " text/html;charset=gb2312 " >
& lttitle & gt測試& lt/title & gt;
& lt/head & gt;
& ltbody style = " font-size:10pt " >
& lt腳本語言= " JavaScript " & gt
var NS4 =(文檔.圖層);//哪個瀏覽器?
var IE4 =(document . all);
var win = window//要搜索的窗口。
var n = 0;
函數查找頁面(字符串){
var txt,I,找到了;
if (str == " ")
返回false
//查找給定字符串在頁面上的下壹個出現位置,繞回
//如有必要,從頁面開始。
如果(NS4) {
//從當前點開始查找匹配。如果找不到,倒帶
//回到第壹場比賽。
如果(!win.find(str))
while(win.find(str,false,true))
n++;
其他
n++;
//如果兩個方向都找不到,給出消息。
如果(n == 0)
Alert("在此頁面上找不到。");
}
if (IE4) {
txt = win . document . body . create text range();
//從頁面頂部開始查找第n個匹配項。
for(I = 0;我& lt= n & amp& amp(found = txt.findText(str))!=假;i++) {
txt.moveStart("character ",1);
txt . moveend(" textedit ");
}
//如果找到,標記它並滾動到視圖中。
如果(找到){
txt.moveStart("character ",-1);
txt . find text(str);
txt . select();
txt . scrollintoview();
n++;
}
//否則,從頁面頂部重新開始並查找第壹個匹配項。
否則{
如果(n & gt0) {
n = 0;
findin page(str);
}
//到處找不到,給消息。
其他
Alert("本頁面未找到此話題,請嘗試使用百度的搜索引擎在線查看。");
}
}
返回false
}
& lt/script & gt;
& ltdiv id = " floater " style = " position:absolute;寬度:95px身高:105 px;z指數:10;可見性:可見;右:10px;top: 13px " >
& ltdiv align = " center " style = " width:158;身高:245 " >
& lt腳本語言= JavaScript & gt
self . on error = null;
currentX = currentY = 0;
whichIt = null
lastScrollX = 0;last scrolly = 0;
NS =(文檔.圖層)?1 : 0;
IE = (document.all)?1: 0;
& lt!-跟蹤者代碼-& gt;
函數心跳(){
if(IE){ diffY = document . body . scroll top;diffX = document . body . scroll left;}
if(NS){ diffY = self . page yo offset;diffX = self.pageXOffset}
如果(diffY!= lastScrollY) {
percent = . 1 *(diffY-last scrolly);
if(百分比& gt0)percent = math . ceil(percent);
else percent = Math.floor(百分比);
if(IE)document . all . floater . style . pixel top+= percent;
if(NS)document . floater . top+= percent;
last scrolly = last scrolly+percent;
}
如果(diffX!= lastScrollX) {
percent = . 1 *(diffX-lastScrollX);
if(百分比& gt0)percent = math . ceil(percent);
else percent = Math.floor(百分比);
if(IE)document . all . floater . style . pixel left+= percent;
if(NS)document . floater . left+= percent;
lastScrollX = lastScrollX+percent;
}
}
& lt!-/跟蹤者代碼-& gt;
& lt!-拖放代碼-& gt;
函數檢查焦點(x,y) {
stalkerx = document . floater . pagex;
stalkery = document . floater . pakey;
stalker width = document . floater . clip . width;
stalker height = document . floater . clip . height;
如果((x & gt斯塔爾克斯& amp& ampx & lt(stalkerx+stalkerwidth))& amp;& amp(y & gtstalkery & amp& ampy & lt(stalkery+stalkerheight)))返回true
否則返回false
}
函數grabIt(e) {
如果{
which it = event . src element;
while(which it . id . index of(" floater ")= =-1){
which it = which it . parent element;
if (whichIt == null) {返回true}
}
which it . style . pixel left = which it . offset left;
which it . style . pixel top = which it . offsettop;
currentX =(event . clientx+document . body . scroll left);
currentY =(event . clienty+document . body . scroll top);
}否則{
window.captureEvents(事件。MOUSEMOVE);
if(checkFocus (e.pageX,e.pageY)) {
whichIt = document.floater
StalkerTouchedX = e . pagex-document . floater . pagex;
stalker touchedy = e . pakey-document . floater . pakey;
}
}
返回true
}
函數moveIt(e) {
if (whichIt == null) {返回false}
如果{
newX =(event . clientx+document . body . scroll left);
newY =(event . clienty+document . body . scroll top);
distance x =(newX-currentX);distance y =(newY-currentY);
currentX = newXcurrentY = newY
which it . style . pixel left+= distance x;
which it . style . pixel top+= distance y;
if(which it . style . pixel top & lt;document . body . scroll top)which it . style . pixel top = document . body . scroll top;
if(which it . style . pixel left & lt;document . body . scroll left)which it . style . pixel left = document . body . scroll left;
if(which it . style . pixel left & gt;document . body . offsetwidth-document . body . scroll left-which it . style . pixel width-20)which it . style . pixel left = document . body . offsetwidth-which it . style . pixel width-20;
if(which it . style . pixel top & gt;document . body . offset height+document . body . scroll top-which it . style . pixel height-5)which it . style . pixel top = document . body . offset height+document . body . scroll top-which it . style . pixel height-5;
event.returnValue = false
}否則{
which it . move to(e . pagex-StalkerTouchedX,e . pagey-StalkerTouchedY);
if(which it . left & lt;0+self . pagexoffset)which it . left = 0+self . pagexoffset;
if(which it . top & lt;0+self . page yo offset)which it . top = 0+self . page yo offset;
if((which it . left+which it . clip . width)& gt;=(window . inner width+self . pagexoffset-17))which it . left =((window . inner width+self . pagexoffset)-which it . clip . width)-17;
if((which it . top+which it . clip . height)& gt;=(window . inner height+self . page yo offset-17))which it . top =((window . inner height+self . page yo offset)-which it . clip . height)-17;
返回false
}
返回false
}
函數dropIt() {
whichIt = null
if(NS) window.releaseEvents(事件。MOUSEMOVE);
返回true
}
& lt!-拖放代碼-& gt;
if(NS) {
window.captureEvents(事件。MOUSEUP |事件。MOUSEDOWN);
window.onmousedown = grabIt
window.onmousemove = moveIt
window.onmouseup = dropIt
}
如果{
document.onmousedown = grabIt
document.onmousemove = moveIt
document.onmouseup = dropIt
}
if(NS | | IE)action = window . setinterval(" heart beat()",1);
& lt/script & gt;
& ltform name = " search " on submit = " return findin page(this . string . value);"& gt
& ltfont size = 3 & gt& ltfont color="#FF0000 " >& ltbr & gt
請輸入關鍵字:
& lt/font & gt;& ltbr & gt
& ltinput name = " string " type = " text " size = 10 onChange = " n = 0;& gt& ltbr & gt
& lt/font & gt;& ltbr & gt
& lt輸入類型= "提交"值= "搜索" >
& ltinput type = " submit " value = " continue check " > & lt;br & gt
& lt/form & gt;
& lt/div & gt;
& lt/div & gt;
& lt腳本語言= JavaScript & gt
self . on error = null;
currentX = currentY = 0;
whichIt = null
lastScrollX = 0;last scrolly = 0;
NS =(文檔.圖層)?1 : 0;
IE = (document.all)?1: 0;
& lt!-跟蹤者代碼-& gt;
函數心跳(){
if(IE){ diffY = document . body . scroll top;diffX = document . body . scroll left;}
if(NS){ diffY = self . page yo offset;diffX = self.pageXOffset}
如果(diffY!= lastScrollY) {
percent = . 1 *(diffY-last scrolly);
if(百分比& gt0)percent = math . ceil(percent);
else percent = Math.floor(百分比);
if(IE)document . all . floater . style . pixel top+= percent;
if(NS)document . floater . top+= percent;
last scrolly = last scrolly+percent;
}
如果(diffX!= lastScrollX) {
percent = . 1 *(diffX-lastScrollX);
if(百分比& gt0)percent = math . ceil(percent);
else percent = Math.floor(百分比);
if(IE)document . all . floater . style . pixel left+= percent;
if(NS)document . floater . left+= percent;
lastScrollX = lastScrollX+percent;
}
}
& lt!-/跟蹤者代碼-& gt;
& lt!-拖放代碼-& gt;
函數檢查焦點(x,y) {
stalkerx = document . floater . pagex;
stalkery = document . floater . pakey;
stalker width = document . floater . clip . width;
stalker height = document . floater . clip . height;
如果((x & gt斯塔爾克斯& amp& ampx & lt(stalkerx+stalkerwidth))& amp;& amp(y & gtstalkery & amp& ampy & lt(stalkery+stalkerheight)))返回true
否則返回false
}
函數grabIt(e) {
如果{
which it = event . src element;
while(which it . id . index of(" floater ")= =-1){
which it = which it . parent element;
if (whichIt == null) {返回true}
}
which it . style . pixel left = which it . offset left;
which it . style . pixel top = which it . offsettop;
currentX =(event . clientx+document . body . scroll left);
currentY =(event . clienty+document . body . scroll top);
}否則{
window.captureEvents(事件。MOUSEMOVE);
if(checkFocus (e.pageX,e.pageY)) {
whichIt = document.floater
StalkerTouchedX = e . pagex-document . floater . pagex;
stalker touchedy = e . pakey-document . floater . pakey;
}
}
返回true
}
函數moveIt(e) {
if (whichIt == null) {返回false}
如果{
newX =(event . clientx+document . body . scroll left);
newY =(event . clienty+document . body . scroll top);
distance x =(newX-currentX);distance y =(newY-currentY);
currentX = newXcurrentY = newY
which it . style . pixel left+= distance x;
which it . style . pixel top+= distance y;
if(which it . style . pixel top & lt;document . body . scroll top)which it . style . pixel top = document . body . scroll top;
if(which it . style . pixel left & lt;document . body . scroll left)which it . style . pixel left = document . body . scroll left;
if(which it . style . pixel left & gt;document . body . offsetwidth-document . body . scroll left-which it . style . pixel width-20)which it . style . pixel left = document . body . offsetwidth-which it . style . pixel width-20;
if(which it . style . pixel top & gt;document . body . offset height+document . body . scroll top-which it . style . pixel height-5)which it . style . pixel top = document . body . offset height+document . body . scroll top-which it . style . pixel height-5;
event.returnValue = false
}否則{
which it . move to(e . pagex-StalkerTouchedX,e . pagey-StalkerTouchedY);
if(which it . left & lt;0+self . pagexoffset)which it . left = 0+self . pagexoffset;
if(which it . top & lt;0+self . page yo offset)which it . top = 0+self . page yo offset;
if((which it . left+which it . clip . width)& gt;=(window . inner width+self . pagexoffset-17))which it . left =((window . inner width+self . pagexoffset)-which it . clip . width)-17;
if((which it . top+which it . clip . height)& gt;=(window . inner height+self . page yo offset-17))which it . top =((window . inner height+self . page yo offset)-which it . clip . height)-17;
返回false
}
返回false
}
函數dropIt() {
whichIt = null
if(NS) window.releaseEvents(事件。MOUSEMOVE);
返回true
}
& lt!-拖放代碼-& gt;
if(NS) {
window.captureEvents(事件。MOUSEUP |事件。MOUSEDOWN);
window.onmousedown = grabIt
window.onmousemove = moveIt
window.onmouseup = dropIt
}
如果{
document.onmousedown = grabIt
document.onmousemove = moveIt
document.onmouseup = dropIt
}
if(NS | | IE)action = window . setinterval(" heart beat()",1);
& lt/script & gt;
& ltp & gt& ltb & gt題庫
& ltp & gt請在右邊的搜索框中找到它。在這壹頁找到它
& ltbr & gt
“饅頭是誰發明的?”,“諸葛亮”,
“蠶蟻”是螞蟻還是蠶?”,“蠶”,< br & gt
古詩詞的體系叫“雅頌”,其中的“頌”是指:“,“宗廟樂歌”,
“目前只有哪家金融機構可以在縣域設立分支機構?”,“中國農業銀行”,< br & gt
“東漢末年,我國傑出的醫學家是”“華佗”,
“地面越高,空氣越稀薄,因為:“,“空氣受地球引力影響”,
& lt/P & gt;
& lt/body & gt;
& lt/html & gt;
疲倦的
該加分了。