javascript 各种 Tips

The width of the tooltips is adapted automatically. Of course you can also specify the width if you like to. The tooltips may contain plain text as well as HTML, lists etc.. If you like, you can customize these crossbrowser JavaScript Tooltips and their behavior in multiple ways. You can change the default configuration values inside the library itself (section GLOBAL TOOLTIP CONFIGURATION), or configure each tooltip individually by passing commands to the onmouseover eventhandlers. 
This Tooltip DHTML Library is even capable of dynamically converting arbitrary HTML elements to tooltips, which means you can put really important stuff into tooltips, since HTML content is relevant to web search engines. Documentation.
 
ContractedBlock.gif ExpandedBlockStart.gif Code
<script type="text/javascript" src="http://www.walterzorn.com/scripts/wz_tooltip.js"></script>


<div>The 
<onmouseover="TagToTip('T2TAdaptWidth')" 
onmouseout
=UnTip() href="javascript:void(0)">width</A> of the tooltips is adapted automatically. 
<SPAN style="DISPLAY: none" id=T2TAdaptWidth>Of course you can also specify the width if you like to.
</SPAN> The tooltips may contain plain text as well as HTML, such as 
<onmouseover="Tip('Tooltip containing an image, inserted into the tooltip text via &amp;lt;img&amp;gt; \
tag<br><img src=http://www.walterzorn.com/images/tooltip/leop.jpg width=150 height=102>', WIDTH, 150, PADDING, 6, BGCOLOR, '#ffffff')"
 
onmouseout
=UnTip() href="javascript:void(0);">images</A>, line 
<onmouseover="Tip('Text with line<br>break, enforced by a &amp;lt;br&amp;gt; HTML tag')" 
onmouseout
=UnTip() href="javascript:void(0)">breaks</A>
<onmouseover="Tip('<table border=\'0\' cellspacing=\'5\'><tr><th colspan=\'2\' style=\'font-size:8pt;background:#ffcccc;\'>\
HTML table in tooltip<\/th><\/tr><tr><td style=\'font-size:8pt;background:#ffffff;\'>Row 2, Cell 1<\/td>\
<td style=\'font-size:8pt;background:#ffffff;\'>Row 2, Cell 2<\/td><\/tr><tr><td style=\'font-size:8pt;background:#ffffff;\'>Row 3, Cell 1<\/td>\
<td style=\'font-size:8pt;background:#ffffff;\'>Row 3, Cell 2<\/td><\/tr><\/table>')"
 
onmouseout
=UnTip() href="javascript:void(0)">tables</A>, lists etc.. If you like, you can 
<onmouseover="Tip('Tooltip with altered font and colors', TITLE, 'This one has a title', BGCOLOR, '#ffcccc', FONTCOLOR, '#800000',
FONTSIZE, '9pt', FONTFACE, 'Courier New, Courier, mono', BORDERCOLOR, '#c00000')"
 
onmouseout
=UnTip() href="javascript:void(0);">customize</A> 
<IMG onmouseover="Tip('Tooltip applied to an IMG tag, and animated using the FADEIN and FADEOUT commands. \
(That\'s me on a quick 200km trip with my homebuilt carbon lowracer.)', WIDTH, 300, FADEIN, 500, FADEOUT, 500)"
 title="" 
onmouseout
=UnTip() hspace=8 alt="" vspace=8 align=left 
src="http://www.walterzorn.com/images/kreuzot_ss.jpg" width=200 height=105> these crossbrowser JavaScript Tooltips and their 
<onmouseover="Tip('A tooltip that fades in and out (FADEIN and FADEOUT commands) and is placed\
 above the mousepointer (ABOVE command).', WIDTH, 250, ABOVE, true, OFFSETX, 1, FADEIN, 400, FADEOUT, 300)"
 
 onmouseout
=UnTip() href="javascript:void(0);">behavior</A> 
 in multiple ways. You can change the default configuration values inside the library itself
 (section GLOBAL TOOLTIP CONFIGURATION), or configure each tooltip individually by passing 
 
<onmouseover="Tip('For examples on how to alter the behaviour and look of tooltips, \
 see the <a href=\'#docu\'>documentation<\/a>', WIDTH, 300, TITLE, 'Tooltip Configuration', 
 SHADOW, true, FADEIN, 300, FADEOUT, 300, STICKY, 1, CLOSEBTN, true, CLICKCLOSE, true)"
 
 onmouseout
=UnTip() href="#docu">commands</A> to the onmouseover eventhandlers. 
 
<BR>&nbsp;<BR>There are also
 
<onmouseover="TagToTip('T2TBalloon', BALLOON, true, ABOVE, true, WIDTH, 260, PADDING, 8, 
 TEXTALIGN, 'justify', OFFSETX, -17)"
 
 onmouseout
=UnTip() href="#extensions">Extensions (plugins)</A> 
 available (or write your own!) which provide additional options to customize the tooltips. 
 
<SPAN style="DISPLAY: none" id=T2TBalloon>For example, to create a <B>balloon tooltip</B> 
 like this one, just include the JavaScript plugin "tip_balloon.js" into your page and apply the 
 BALLOON command to the tooltip.
</SPAN> <BR>&nbsp;<BR>This Tooltip DHTML Library is even capable of 
 dynamically converting arbitrary HTML elements to tooltips, which means you can put really important 
 stuff into tooltips, since HTML content is relevant to web search engines. 
 
<onmouseover="Tip('An HTML element can be converted to a tooltip just by its ID. See \
 <a href=#docu>documentation<\/a>.', TITLE, 'Extended Possibilities', WIDTH, 300, SHADOW,
  true, STICKY, 1, CLOSEBTN, true, CLICKCLOSE, true)"
 onmouseout=UnTip() href="#docu">Documentation</A></div>

转载于:https://www.cnblogs.com/zjm1126qqcom/archive/2009/05/24/1488254.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值