自定义的Title

可以学习到各种虑镜的切换效果,外观还是不错的。
复制过来,竟然没有了Tab,竟然都对齐了,郁闷阿,没有上传空间,没法子看,呵呵~

共有三个文件:
Title.css
BODY {FONT-SIZE: 11px; MARGIN: 0px; COLOR: #000000; FONT-FAMILY: verdana, 宋体, fantasy; BACKGROUND-COLOR: #eff0e2; TEXT-ALIGN: center}
TH   {BORDER-RIGHT: #c0c0c0 1px solid; FONT-WEIGHT: bold; FONT-SIZE: 11px; BORDER-LEFT: #c0c0c0 1px solid; COLOR: white; LINE-HEIGHT: normal; BACKGROUND-COLOR: #669900}
.CTitle  {behavior: url(Title.htc);}
.TitleTable {filter:progid:DXImageTransform.Microsoft.DropShadow(color=#CECFCD,offX=3,offY=3);BORDER-RIGHT: #669900 1px solid; BORDER-TOP: #669900 1px solid; BORDER-LEFT: #669900 1px solid; BORDER-BOTTOM: #669900 1px solid; BACKGROUND-COLOR: #fff}
.TitleContent  {LINE-HEIGHT: normal; BACKGROUND-COLOR: #ffffff;FONT-SIZE: 11px; LINE-HEIGHT: 18px; FONT-FAMILY: verdana, 宋体, fantasy}

Title.Htc:(Unicode编码或者UTF-8编码,避免汉字在网页上报错)
<PUBLIC:COMPONENT lightWeight=false>
<PUBLIC:DEFAULTS contentEditable=false tabStop=true/>
<PUBLIC:ATTACH onevent="mouseover()" event="onmouseover"/>
<PUBLIC:ATTACH onevent="mousemove()" event="onmousemove"/>
<PUBLIC:ATTACH onevent="mouseout()" event="onmouseout"/>
<script language="VBScript">
option explicit
'*********************************************************************
'说明:蒋玉龙编写于2006年4月
'Email:loving-kiss@163.com
'Tel:保密
'QQ:66840199 转载请保留信息
'版本:1.01
'耗时半天,搜索虑镜,设置样式,这次比较繁琐~~真正写代码时间不多。
'//最初原版:http://cnstat.net(我也没见过,呵呵)
'//JS版本改编By小虫虫,QQ:38477904  蒋玉龙改编为VBS版本HTC方式
'=====================================================================
Dim TitleName,TopicNowrap,ContentNowrap
TitleName="蒋玉龙问侯您" 'Title:默认题头
TopicNowrap="Nowrap"  '默认标题栏不换行
ContentNowrap=""  '默认内容换行
'=====================================================================
Sub mouseover()
On Error Resume Next
Dim RndNumber
If Window.Document.GetElementById("LovingkissTipLayer") Is Nothing Then
 CreatTable
End If
'获取内容<Title>
window.document.all("TitleContent").InnerHtml=GetInfo(Window.Event.SrcElement)
Randomize '显示
RndNumber=Int((29 * Rnd) + 1)  '1-30个虑镜效果
With window.document.all("LovingkissTipLayer")
 .filters(RndNumber).apply
 .Style.Display=""
 .filters(RndNumber).play
End With
End Sub

Sub mousemove()
On Error Resume Next
'执行顺序:mousemove(移动就触发)->mouseover->mouseout
If Not (window.document.GetElementById("LovingkissTipLayer") Is Nothing) Then
 SetTitlePlace
End If
End Sub

Sub mouseout()
On Error Resume Next
window.document.all("LovingkissTipLayer").Style.Display="none"
End Sub

Sub SetTitlePlace()
On Error Resume Next
If window.event.clientX+10+window.document.all("cTitleTable").offsetWidth> Screen.width Then '提示表格的在屏幕之外了
 window.document.all("LovingkissTipLayer").style.Left = window.event.clientX+window.document.body.scrollLeft-10-window.document.all("cTitleTable").offsetWidth
Else
 window.document.all("LovingkissTipLayer").style.Left = window.event.clientX+window.document.body.scrollLeft+10
End If
window.document.all("LovingkissTipLayer").style.Top=window.event.clientY+10
End Sub

Function GetInfo(CurObject)
On Error Resume Next
GetInfo="[空信息]"
If Trim(CurObject.Title)<>"" Then
 GetInfo=CurObject.Title 
End If
End Function

Sub CreatTable()
'创建表格所在Div
On Error Resume Next
Dim MyDiv,StrFilter,StrMic
Dim MyTable
StrMic="progid:DXImageTransform.Microsoft."
StrFilter="revealTrans() " '分行写比较明了,为了更容易维护和调整
StrFilter=StrFilter & StrMic & "Fade(Overlap=1.00 enabled=0)"
StrFilter=StrFilter & StrMic & "Inset(enabled=0)"
StrFilter=StrFilter & StrMic & "Iris(irisstyle=PLUS,motion=in enabled=0)"
StrFilter=StrFilter & StrMic & "Iris(irisstyle=PLUS,motion=out enabled=0)"
StrFilter=StrFilter & StrMic & "Iris(irisstyle=DIAMOND,motion=in enabled=0)"
StrFilter=StrFilter & StrMic & "Iris(irisstyle=DIAMOND,motion=out enabled=0)"
StrFilter=StrFilter & StrMic & "Iris(irisstyle=CROSS,motion=in enabled=0)"
StrFilter=StrFilter & StrMic & "Iris(irisstyle=CROSS,motion=out enabled=0)"
StrFilter=StrFilter & StrMic & "Iris(irisstyle=STAR,motion=in enabled=0)"
StrFilter=StrFilter & StrMic & "Iris(irisstyle=STAR,motion=out enabled=0)"
StrFilter=StrFilter & StrMic & "RadialWipe(wipestyle=CLOCK enabled=0)"
StrFilter=StrFilter & StrMic & "RadialWipe(wipestyle=WEDGE enabled=0)"
StrFilter=StrFilter & StrMic & "RadialWipe(wipestyle=RADIAL enabled=0)"
StrFilter=StrFilter & StrMic & "Pixelate(MaxSquare=35,enabled=0)"
StrFilter=StrFilter & StrMic & "Slide(slidestyle=HIDE,Bands=25 enabled=0)"
StrFilter=StrFilter & StrMic & "Slide(slidestyle=PUSH,Bands=25 enabled=0)"
StrFilter=StrFilter & StrMic & "Slide(slidestyle=SWAP,Bands=25 enabled=0)"
StrFilter=StrFilter & StrMic & "Spiral(GridSizeX=16,GridSizeY=16 enabled=0)"
StrFilter=StrFilter & StrMic & "Stretch(stretchstyle=HIDE enabled=0)"
StrFilter=StrFilter & StrMic & "Stretch(stretchstyle=PUSH enabled=0)"
StrFilter=StrFilter & StrMic & "Stretch(stretchstyle=SPIN enabled=0)"
StrFilter=StrFilter & StrMic & "Wheel(spokes=16 enabled=0)"
StrFilter=StrFilter & StrMic & "GradientWipe(GradientSize=1.00,wipestyle=0,motion=forward enabled=0)"
StrFilter=StrFilter & StrMic & "GradientWipe(GradientSize=1.00,wipestyle=0,motion=reverse enabled=0)"
StrFilter=StrFilter & StrMic & "GradientWipe(GradientSize=1.00,wipestyle=1,motion=forward enabled=0)"
StrFilter=StrFilter & StrMic & "GradientWipe(GradientSize=1.00,wipestyle=1,motion=reverse enabled=0)"
StrFilter=StrFilter & StrMic & "Zigzag(GridSizeX=8,GridSizeY=8 enabled=0)"
StrFilter=StrFilter & StrMic & "Alpha(enabled=0)"
StrFilter=StrFilter & StrMic & "Dropshadow(OffX=3,OffY=3,Positive=true,enabled=0)"
StrFilter=StrFilter & StrMic & "Shadow(strength=3,direction=135,enabled=0)"
'共30个虑镜效果
Set MyDiv=Document.createElement("DIV") '外层Div
With MyDiv
 .Id="LovingkissTipLayer"
 .Style.Display="none"
 .style.position = "absolute"
 .style.zIndex = 3001
 .Style.Filter=StrFilter
End With
Dim strResponse '表格部分为了明了,就不用createElement的法子生成了
strResponse = "<TABLE class=TitleTable Id=cTitleTable cellSpacing=1 cellPadding=0>"
strResponse = strResponse & vbCrLf & "<TBODY>"
strResponse = strResponse & vbCrLf & "<TR>"
strResponse = strResponse & vbCrLf & "<TH " & TopicNowrap & " id=TitleTopic align=middle height=22 Style=""FONT-SIZE: 11px;FONT-FAMILY: verdana, 宋体, fantasy; "">" & TitleName & "</TH></TR>"
strResponse = strResponse & vbCrLf & "<TR>"
strResponse = strResponse & vbCrLf & "<TD>"
strResponse = strResponse & vbCrLf & "<TABLE cellSpacing=0 cellPadding=3>"
strResponse = strResponse & vbCrLf & "<TBODY>"
strResponse = strResponse & vbCrLf & "<TR>"
strResponse = strResponse & vbCrLf & "<TD id=TitleContent " & ContentNowrap & " class=TitleContent>内容</TD>"
strResponse = strResponse & vbCrLf & "</TR>"
strResponse = strResponse & vbCrLf & "</TBODY>"
strResponse = strResponse & vbCrLf & "</TABLE>"
strResponse = strResponse & vbCrLf & "</TD>"
strResponse = strResponse & vbCrLf & "</TR>"
strResponse = strResponse & vbCrLf & "</TBODY>"
strResponse = strResponse & vbCrLf & "</TABLE>"
MyDiv.InnerHtml=strResponse
window.document.body.insertAdjacentElement "afterBegin",MyDiv
End Sub
</script>
</PUBLIC:COMPONENT>

Title.htm:引用例子
<Span Class="CTitle" Title="嘿嘿,看也是,不看也是!你看什么看啊,<BR>嫩个大变态,嘿嘿,看也是,不看也是!<BR>">
我自己万岁
</Span>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值