|
Saturday, 13 October 2007 |
预览:
{tab=js}
/* Tips 1 */
var Tips1 = new Tips($$('.Tips1'));
/* Tips 2 */
var Tips2 = new Tips($$('.Tips2'),
{ initialize:function(){
this.fx = new Fx.Style(this.toolTip, 'opacity', {duration: 500, wait: false}).set(0); },
onShow: function(toolTip) { this.fx.start(1); },
onHide: function(toolTip) { this.fx.start(0); } });
/* Tips 3 */
var Tips3 = new Tips($$('.Tips3'),
{ showDelay: 400, hideDelay: 400, fixed: true });
/* Tips 4 */
var Tips4 = new Tips($$('.Tips4'),
{ className: 'custom' });%20%2F%2A%20Tips%201%20%2A%2F%0A%0D%0Avar%20Tips1%20%3D%20new%20Tips%28%24%24%28%27.Tips1%27%29%29%3B%20%0A%0D%0A%2F%2A%20Tips%202%20%2A%2F%20%0A%0D%0Avar%20Tips2%20%3D%20new%20Tips%28%24%24%28%27.Tips2%27%29%2C%20%0A%0D%0A%7B%20%20%26nbsp%3B%20%26nbsp%3Binitialize%3Afunction%28%29%7B%20%0A%0D%0Athis.fx%20%3D%20new%20Fx.Style%28this.toolTip%2C%20%27opacity%27%2C%20%7Bduration%3A%20500%2C%20wait%3A%20false%7D%29.set%280%29%3B%20%20%26nbsp%3B%20%26nbsp%3B%7D%2C%0A%0D%0AonShow%3A%20function%28toolTip%29%20%7B%20%20%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bthis.fx.start%281%29%3B%20%20%26nbsp%3B%20%26nbsp%3B%7D%2C%20%0A%0D%0AonHide%3A%20function%28toolTip%29%20%7B%20%20%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bthis.fx.start%280%29%3B%20%20%26nbsp%3B%20%26nbsp%3B%7D%20%20%7D%29%3B%20%0A%0D%0A%2F%2A%20Tips%203%20%2A%2F%20%0A%0D%0Avar%20Tips3%20%3D%20new%20Tips%28%24%24%28%27.Tips3%27%29%2C%0A%0D%0A%7B%20%20%26nbsp%3B%20%26nbsp%3BshowDelay%3A%20400%2C%20%20%26nbsp%3B%20%26nbsp%3BhideDelay%3A%20400%2C%20%20%26nbsp%3B%20%26nbsp%3Bfixed%3A%20true%20%20%7D%29%3B%20%0A%0D%0A%2F%2A%20Tips%204%20%2A%2F%20%0A%0D%0Avar%20Tips4%20%3D%20new%20Tips%28%24%24%28%27.Tips4%27%29%2C%0A%0D%0A%7B%20%20%26nbsp%3B%20%26nbsp%3BclassName%3A%20%27custom%27%20%20%7D%29%3B {tab=html}
<h3>Tips 1</h3>
<img src="/demos/MousewheelCustom/moo.png" alt="mooCow" class="Tips1"
title="Tips Title :: This is my tip content" />
<h3>Tips 2</h3>
<img src="/demos/MousewheelCustom/moo.png" alt="mooCow" class="Tips2"
title="Tips Title :: This is my tip content" />
<h3>Tips 3</h3>
Fixed tooltip:
<a href="http://www.mootools.net" onclick="return false;" class="Tips3"
title="Mootools official website">Mootools.net</a>
<h3>Tips 4</h3>
Custom className:
<a href="http://www.mootools.net" onclick="return false;" class="Tips4"
title="Mootools official website">Mootools.net</a> %3Ch3%3ETips%201%3C%2Fh3%3E%20%0A%0D%0A%3Cimg%20src%3D%22%2Fdemos%2FMousewheelCustom%2Fmoo.png%22%20alt%3D%22mooCow%22%20class%3D%22Tips1%22%20%0A%0D%0Atitle%3D%22Tips%20Title%20%3A%3A%20This%20is%20my%20tip%20content%22%20%2F%3E%20%0A%0D%0A%3Ch3%3ETips%202%3C%2Fh3%3E%0A%0D%0A%3Cimg%20src%3D%22%2Fdemos%2FMousewheelCustom%2Fmoo.png%22%20alt%3D%22mooCow%22%20class%3D%22Tips2%22%20%0A%0D%0Atitle%3D%22Tips%20Title%20%3A%3A%20This%20is%20my%20tip%20content%22%20%2F%3E%20%0A%0D%0A%3Ch3%3ETips%203%3C%2Fh3%3E%20%0A%0D%0AFixed%20tooltip%3A%0A%0D%0A%3Ca%20href%3D%22http%3A%2F%2Fwww.mootools.net%22%20onclick%3D%22return%20false%3B%22%20class%3D%22Tips3%22%20%0A%0D%0Atitle%3D%22Mootools%20official%20website%22%3EMootools.net%3C%2Fa%3E%20%0A%0D%0A%3Ch3%3ETips%204%3C%2Fh3%3E%20%0A%0D%0ACustom%20className%3A%20%0A%0D%0A%3Ca%20href%3D%22http%3A%2F%2Fwww.mootools.net%22%20onclick%3D%22return%20false%3B%22%20class%3D%22Tips4%22%0A%0D%0Atitle%3D%22Mootools%20official%20website%22%3EMootools.net%3C%2Fa%3E {tab=css}
.tool-tip { color: #fff; width: 139px; z-index: 13000; }
.tool-title {
font-weight: bold;
font-size: 11px;
margin: 0;
color: #9FD4FF;
padding: 8px 8px 4px;
background: url(bubble.png) top left; }
.tool-text {
font-size: 11px;
padding: 4px 8px 8px;
background: url(bubble.png) bottom right; }
.custom-tip {
color: #000;
idth: 130px;
z-index: 13000;
}
.custom-title
{
fnt-weight: bold;
font-size: 11px;
margin: 0;
color: #3E4F14;
padding: 8px 8px 4px;
background: #C3DF7D;
border-bottom: 1px solid #B5CF74; }
.custom-text {
font-size: 11px;
padding: 4px 8px 8px;
background: #CFDFA7; }.tool-tip%20%7B%20%20%26nbsp%3B%20%26nbsp%3Bcolor%3A%20%23fff%3B%20%20%26nbsp%3B%20%26nbsp%3Bwidth%3A%20139px%3B%20%20%26nbsp%3B%20%26nbsp%3Bz-index%3A%2013000%3B%20%20%7D%20%0A%0D%0A.tool-title%20%7B%20%0A%0D%0Afont-weight%3A%20bold%3B%20%0A%0D%0Afont-size%3A%2011px%3B%20%0A%0D%0Amargin%3A%200%3B%20%0A%0D%0Acolor%3A%20%239FD4FF%3B%0A%0D%0Apadding%3A%208px%208px%204px%3B%20%0A%0D%0Abackground%3A%20url%28bubble.png%29%20top%20left%3B%20%20%7D%0A%0D%0A.tool-text%20%7B%20%0A%0D%0Afont-size%3A%2011px%3B%0A%0D%0Apadding%3A%204px%208px%208px%3B%20%0A%0D%0Abackground%3A%20url%28bubble.png%29%20bottom%20right%3B%20%20%7D%20%0A%0D%0A.custom-tip%20%7B%20%0A%0D%0Acolor%3A%20%23000%3B%20%0A%0D%0Aidth%3A%20130px%3B%20%0A%0D%0Az-index%3A%2013000%3B%20%0A%0D%0A%7D%20%0A%0D%0A.custom-title%20%0A%0D%0A%7B%20%0A%0D%0Afnt-weight%3A%20bold%3B%20%0A%0D%0Afont-size%3A%2011px%3B%20%0A%0D%0Amargin%3A%200%3B%20%0A%0D%0Acolor%3A%20%233E4F14%3B%20%0A%0D%0Apadding%3A%208px%208px%204px%3B%0A%0D%0Abackground%3A%20%23C3DF7D%3B%20%0A%0D%0Aborder-bottom%3A%201px%20solid%20%23B5CF74%3B%20%20%7D%20%0A%0D%0A.custom-text%20%7B%20%0A%0D%0Afont-size%3A%2011px%3B%20%0A%0D%0Apadding%3A%204px%208px%208px%3B%20%0A%0D%0Abackground%3A%20%23CFDFA7%3B%20%20%7D {/tabs}
来源:http://demos.mootools.net/Tips/
|