国产探花免费观看_亚洲丰满少妇自慰呻吟_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ā)表
主站蜘蛛池模板: 土默特右旗| 马关县| 徐闻县| 高陵县| 陵川县| 开封县| 隆林| 柯坪县| 建宁县| 辉县市| 深水埗区| 呼伦贝尔市| 南雄市| 泾源县| 资阳市| 扶风县| 稻城县| 东阿县| 清新县| 宜丰县| 保德县| 天祝| 什邡市| 汤原县| 石柱| 霸州市| 璧山县| 府谷县| 名山县| 阿图什市| 天长市| 防城港市| 忻城县| 乌拉特后旗| 镇江市| 昭通市| 新营市| 武川县| 抚松县| 华安县| 宕昌县|