120急救车接人收费标准:求一个JAVAScript特效

来源:百度文库 编辑:高校问答 时间:2024/04/28 13:24:48
万旭打不开,只好来找大家!
具体要求是:把鼠标放超链接上时,会有文字提示,文字要带点特效(不然不就和title一样了?)

<html>
<head>
<title>测试</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
a { font-family: "tahoma"; font-size: 10px; color: #333333; text-decoration: none}
a:hover { font-family: "tahoma"; font-size: 10px; color: #999999; text-decoration: none}
div { font-family: "tahoma"; font-size: 10px; color: #0099CC}
-->
</style>
</head>
<SCRIPT LANGUAGE="JavaScript">

window.onerror = null;
var bName = navigator.appName;
var bVer = parseInt(navigator.appVersion);
var NS4 = (bName == "Netscape" && bVer >= 4);
var IE4 = (bName == "Microsoft Internet Explorer"
&& bVer >= 4);
var NS3 = (bName == "Netscape" && bVer < 4);
var IE3 = (bName == "Microsoft Internet Explorer"
&& bVer < 4);
var scroll_length = 50; //The scroll length
var time_length =1; //Scroll speed
var begin_pos = 0; //Start position of scroll hint
var i;
var j;
if (NS4 || IE4) {
if (navigator.appName == "Netscape") {
layerStyleRef="layer.";
layerRef="document.layers";
styleSwitch="";
}else{
layerStyleRef="layer.style.";
layerRef="document.all";
styleSwitch=".style";
}
}
//SCROLL
function Scroll(layerName){
if (NS4 || IE4) {
if (NS4 || IE4) {
if(i<(begin_pos+scroll_length)){
eval(layerRef+'["'+layerName+'"]'+
styleSwitch+'.visibility="visible"');
eval(layerRef+'["'+layerName+'"]'+
styleSwitch+'.left="'+i+'"');
i++;
j++;
if(i==j){
setTimeout("Scroll('"+layerName+"')",time_length);}
}
}
}
}
//STOP SCROLLING
function StopScroll(layerName)
{
i=begin_pos+scroll_length;
eval(layerRef+'["'+layerName+'"]'+
styleSwitch+'.left="'+i+'"');
hideLayer(layerName);
}
function reset()
{
i=begin_pos;
j=i;
}
// HIDE HINT
function hideLayer(layerName){
if (NS4 || IE4) {
eval(layerRef+'["'+layerName+'"]'+
styleSwitch+'.visibility="hidden"');
}
}
</script>
<body bgcolor="#FFFFFF" text="#000000">
<a href="#" class="link" onmouseover="javascript:reset();Scroll('prem_hint');" onmouseout="javascript:StopScroll('prem_hint');">Move your mouse over this link</a>
<div id="prem_hint" style="position:relative; visibility:hidden" class="prem_hint">
This is the hint or description for the above link!
</div>
</body>
</html>