国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發(fā) > JS > 正文

做網(wǎng)頁的一些技巧(續(xù))

2024-09-06 12:43:33
字體:
供稿:網(wǎng)友

Q: 實(shí)現(xiàn)雙擊自動(dòng)滾屏.
A: 將以下代碼添加到需要自動(dòng)滾屏的頁面上

<s cript Language="Javas cript">
var currentpos, timer;
function initialize(){
timer = setInterval("scrollwindow()", 1);
}
function sc(){
clearInterval(timer);
}
function scrollwindow(){
currentpos = document.body.scrollTop;
window.scroll(0, ++currentpos);
if(currentpos != document.body.scrollTop){
sc();
}
}
document.onmousedown = sc;
document.ondblclick = initialize;
</s cript>

Q: 鼠標(biāo)特效 。
A: 鼠標(biāo)放到鏈接上就會(huì)出現(xiàn)一個(gè)說明框,里面有滾動(dòng)的文字說明

<a target="_blank" onMouseOver="helpor_net_show(this,event,' 這里是小郭的個(gè)人主頁 ')" onMouseOut="helpor_net_hide()"> 把鼠標(biāo)放上來試試
<div id="tooltip2" style="position:absolute;visibility:hidden;clip:rect(0 150 50 0);width:150px;background-color:seashell">
<layer name="nstip" width="1000px" bgColor="seashell"></layer>
</div>
<SCRIPT language="JavaScript">
<!--
if (!document.layers&&!document.all)
event="test"
function helpor_net_show(current,e,text){

if (document.all&&document.readyState=="complete"){
document.all.tooltip2.innerHTML='<marquee style="border:1px solid #3399ff">'+text+'</marquee>'
document.all.tooltip2.style.pixelLeft=event.clientX+document.body.scrollLeft+10
document.all.tooltip2.style.pixelTop=event.clientY+document.body.scrollTop+10
document.all.tooltip2.style.visibility="visible"
}

else if (document.layers){
document.tooltip2.document.nstip.document.write(' '+text+' ')
document.tooltip2.document.nstip.document.close()
document.tooltip2.document.nstip.left=0
currentscroll=setInterval("scrolltip()",100)
document.tooltip2.left=e.pageX+10
document.tooltip2.top=e.pageY+10
document.tooltip2.visibility="show"
}
}
function helpor_net_hide(){
if (document.all)
document.all.tooltip2.style.visibility="hidden"
else if (document.layers){
clearInterval(currentscroll)
document.tooltip2.visibility="hidden"
}
}

function scrolltip(){
if (document.tooltip2.document.nstip.left>=-document.tooltip2.document.nstip.document.width)
document.tooltip2.document.nstip.left-=5
else
document.tooltip2.document.nstip.left=150
}
//-->
</SCRIPT>

Q: 文本隨機(jī)輸出,可以用來作公告欄 。
A: 腳本說明 :
第一步 : 把如下代碼加入 <head> 區(qū)域中
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Tarjei Davidsen (the@rescueteam.com) -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 张北县| 汕尾市| 永和县| 南皮县| 虹口区| 兴业县| 瑞安市| 县级市| 囊谦县| 同心县| 金湖县| 上犹县| 凌源市| 汨罗市| 赣州市| 行唐县| 卫辉市| 罗城| 丰台区| 集安市| 黄骅市| 安平县| 满城县| 承德县| 宜城市| 康马县| 大同县| 梓潼县| 福清市| 中卫市| 清新县| 陈巴尔虎旗| 崇仁县| 井陉县| 含山县| 安溪县| 维西| 阳西县| 运城市| 思南县| 台东县|