视频1
视频21
视频41
视频61
视频文章1
视频文章21
视频文章41
视频文章61
推荐1
推荐3
推荐5
推荐7
推荐9
推荐11
推荐13
推荐15
推荐17
推荐19
推荐21
推荐23
推荐25
推荐27
推荐29
推荐31
推荐33
推荐35
推荐37
推荐39
推荐41
推荐43
推荐45
推荐47
推荐49
关键词1
关键词101
关键词201
关键词301
关键词401
关键词501
关键词601
关键词701
关键词801
关键词901
关键词1001
关键词1101
关键词1201
关键词1301
关键词1401
关键词1501
关键词1601
关键词1701
关键词1801
关键词1901
视频扩展1
视频扩展6
视频扩展11
视频扩展16
文章1
文章201
文章401
文章601
文章801
文章1001
资讯1
资讯501
资讯1001
资讯1501
标签1
标签501
标签1001
关键词1
关键词501
关键词1001
关键词1501
专题2001
全部频道
首页
科技
教育
生活
旅游
时尚
美容
美食
健康
体育
游戏
汽车
元宇宙
家电
财经
综合
宠物
如何丰富alt属性的显示效果_javascript技巧
2020-11-27 20:34:34
责编:小采
点击下载本文
文档为doc格式
IE默认会给带alt属性图片和带title的链接一个浮动显示
蓝色理想
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
很多朋友觉得不好看或者功能不丰富想改改,搜集了几种办法大家研究下
var oPopup = window.createPopup(); function fnDef() { oPopup.document.body.innerHTML = ""+event.srcElement.title+""; var popupBody = oPopup.document.body; oPopup.show(0, 0, 300, 50); var realHeight = popupBody.scrollHeight; oPopup.hide(); oPopup.show(0, 15 , 300, realHeight, event.srcElement); }
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
var ns4 = document.layers; var ns6 = document.getElementById && !document.all; var ie4 = document.all; offsetX = 0; offsetY = 20; var toolTipSTYLE=""; function initToolTips() { if(ns4||ns6||ie4) { if(ns4) toolTipSTYLE = document.toolTipLayer; else if(ns6) toolTipSTYLE = document.getElementById("toolTipLayer").style; else if(ie4) toolTipSTYLE = document.all.toolTipLayer.style; if(ns4) document.captureEvents(Event.MOUSEMOVE); else { toolTipSTYLE.visibility = "visible"; toolTipSTYLE.display = "none"; } document.onmousemove = moveToMouseLoc; } } function toolTip(msg, fg, bg) { if(toolTip.arguments.length < 1) // hide { if(ns4) toolTipSTYLE.visibility = "hidden"; else toolTipSTYLE.display = "none"; } else // show { if(!fg) fg = "#777777"; if(!bg) bg = "#FFFFFF"; var content = '
' + '
 \;' + msg + ' \;
'; if(ns4) { toolTipSTYLE.document.write(content); toolTipSTYLE.document.close(); toolTipSTYLE.visibility = "visible"; } if(ns6) { document.getElementById("toolTipLayer").innerHTML = content; toolTipSTYLE.display='block' } if(ie4) { document.all("toolTipLayer").innerHTML=content; toolTipSTYLE.display='block' } } } function moveToMouseLoc(e) { if(ns4||ns6) { x = e.pageX; y = e.pageY; } else { x = event.x + document.body.scrollLeft; y = event.y + document.body.scrollTop; } toolTipSTYLE.left = x + offsetX; toolTipSTYLE.top = y + offsetY; return true; } script> 四川辣椒的艺术 (转) script>
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
var tipTimer; function locateObject(n, d) { //v3.0 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i
'+unescape(tipContent)+'
' if ((e.x + locateObject(object).clientWidth) > (document.body.clientWidth + document.body.scrollLeft)) { locateObject(object).style.left = (document.body.clientWidth + document.body.scrollLeft) - locateObject(object).clientWidth-10; } else { locateObject(object).style.left=document.body.scrollLeft+event.clientX } locateObject(object).style.visibility="visible" tipTimer=window.setTimeout("hideTooltip('"+object+"')", displaytime); return true; } else if (document.layers) { locateObject(object).document.write('
'+unescape(tipContent)+'
') locateObject(object).document.close() locateObject(object).top=e.y+20 if ((e.x + locateObject(object).clip.width) > (window.pageXOffset + window.innerWidth)) { locateObject(object).left = window.innerWidth - locateObject(object).clip.width-10; } else { locateObject(object).left=e.x; } locateObject(object).visibility="show" tipTimer=window.setTimeout("hideTooltip('"+object+"')", displaytime); return true; } else { return true; } } script> ', '#fffff2','#000000','#000000','20000')" onMouseOut="hideTooltip('dHTMLToolTip')">点这里
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
// Location of this script: // http://www.geocities.com/e_i_search/premshree/pub/scripts/JS/link_hint_scroller.htm //********************************************* //* Link Hint Scroller 1.0 * //* This script when you move your mouse over * //* displays a scrolling hint * //* (c) Premshree Pillai, * //* http://qik.cjb.net * //* E-mail : premshree@hotmail.com * //* Use the script freely as long as this * //* message is intact * //********************************************* 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 = 150; //The scroll length var time_length =50; //Scroll speed var begin_pos = 100; //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>
Link Hint Scroller 1.0 Move your mouse over
This is the hint or description for the above link!
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
下载本文
显示全文
专题
动视 51dongshi.net 版权所有
Copyright © 2019-2025