The Ext.QuickTips functionality provides attractive and customizable tooltips for any element. Adobe didn't add any QuickTips functionality to ColdFusion 8, but the JavaScript files to support it are included with the other Ext related files in the "CFIDE/scripts" directory, so I am going to show you a couple simple ways you can utilize them to enhance your tooltips.

In this first example, I will show you how to register a quick tip directly from your HTML tags. To add a QuickTip to any element of your page you simply add one or more of the valid QuickTip attributes prefixed with the ext: namespace to the HTML tag. The HTML element itself is automatically set as the quick tip target. Here is a summary of supported attributes (optional unless otherwise noted):

  • hide: Specifying "user" will cause the tip to remain visible until the user manually closes it, or clicks on another element. Any other value will cause the tip to hide when the mouse is not over the element.
  • qtip (required): The quick tip text.
  • qtitle: The quick tip title.
  • qwidth: The quick tip width.
  • qclass: A CSS class to be applied to the quick tip.

See the code below in action

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
   <title>QuickTips</title>
   <!--- import all the neccessary JS and CSS files for the QuickTips --->
   <script type="text/javascript" src="/CFIDE/scripts/ajax/ext/adapter/yui/yui-utilities.js"></script>
<script type="text/javascript" src="/CFIDE/scripts/ajax/ext/adapter/yui/ext-yui-adapter.js"></script>
   <script src="/CFIDE/scripts/ajax/ext/ext-all.js" type="text/javascript"></script>
   <link rel="STYLESHEET" type="text/css" href="/CFIDE/scripts/ajax/resources/ext/css/ext-all.css">
   <script src="/CFIDE/scripts/ajax/ext/package/qtips/qtips.js" type="text/javascript"></script>
</head>

<body>
<!--- set up form elements wih quickTip attributes --->
<form name="MyForm">
<b>First Name:</b>
<input id="MyNumberField"
   type="Text"
   name="MyNumberField"
   ext:qtitle="First Name"
   ext:qwidth="100"
   ext:qtip="Enter your first name in this field"
   >
<br>
   
<b>Last Name:</b>
<input id="MyStringField"
   type="Text"
   name="MyStringField"
   ext:qtitle="Last Name"
   ext:qwidth="100"
   ext:qtip="Enter a your last name in this field"
   ext:hide="user">
<br>
   
<input id="SubmitButton"
   type="button" value="Submit"
   ext:qtitle="Submit"
   ext:qwidth="300"
   ext:qtip="Click here to submit the form. (this doesn't really do anything if you click it)">

</form>
<!--- initiate the quick tips --->
<script language="JavaScript">
Ext.QuickTips.init();
</script>
</body>
</html>

Another way to implement the quick tips functionality, would be to enable the interceptTitles config option. This will cause the QuickTips to automatically appear for every HTML element that has the "title" attribute set. You can set an HTML string as the value of the title attribute. This method is a little flawed in Internet Explorer, in that the normal yellow title tooltip appears above the QuickTip the first time you mouse over an element (I believe this can be attributed to how IE uses the title attribute as if it were the alt attribute... who needs standards when you're Microsoft, right?)

See the code below in action

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
   <title>QuickTips</title>
   <!--- import all the neccessary JS and CSS files for the QuickTips --->
   <script type="text/javascript" src="/CFIDE/scripts/ajax/ext/adapter/yui/yui-utilities.js"></script>
<script type="text/javascript" src="/CFIDE/scripts/ajax/ext/adapter/yui/ext-yui-adapter.js"></script>
   <script src="/CFIDE/scripts/ajax/ext/ext-all.js" type="text/javascript"></script>
   <link rel="STYLESHEET" type="text/css" href="/CFIDE/scripts/ajax/resources/ext/css/ext-all.css">
   <script src="/CFIDE/scripts/ajax/ext/package/qtips/qtips.js" type="text/javascript"></script>
   
</head>

<body>
<!--- Set up the form with HTML in the titles --->
<form name="MyForm">
<b>First Name:</b> <input id="FirstName" type="Text" name="FirstName" title="<b>First Name</b><br>Enter your first name in this field"><br>
<b>Last Name:</b> <input id="LastName" type="Text" name="LastName" title="<b>Last Name</b><br>Enter a your last name in this field"><br>
<input id="SubmitButton" type="button" value="Submit" title="<b>Submit</b><br>Click here to submit the form. (this doesn't really do anything if you click it)">
</form>

<!--- initiate the quick tips with interceptTitles set to true --->
<script language="JavaScript">
Ext.QuickTips.interceptTitles = true;
Ext.QuickTips.init();
</script>
</body>
</html>

If you want to customize the colors used in the QuickTips you can make your own style sheet that contains the x-tip classes, then include that instead of the ext-all.css. Here is how those classes are set up in the ext-all.css file, so you can copy them and make changes from there.

.x-tip{
   position: absolute;
   top: 0;
left:0;
visibility: hidden;
   z-index: 20000;
border:0 none;
}
.x-tip .x-tip-close{
   background-image: url(../images/default/qtip/close.gif);
   height: 15px;
   float:right;
   width: 15px;
margin:0 0 2px 2px;
cursor:pointer;
display:none;
}
.x-tip .x-tip-top {
   background: transparent url(../images/default/qtip/tip-sprite.gif) no-repeat 0 -12px;
   height:6px;
overflow:hidden;
}
.x-tip .x-tip-top-left {
   background: transparent url(../images/default/qtip/tip-sprite.gif) no-repeat 0 0;
   padding-left:6px;
zoom:1;
}
.x-tip .x-tip-top-right {
   background: transparent url(../images/default/qtip/tip-sprite.gif) no-repeat right 0;
   padding-right:6px;
zoom:1;
}
.x-tip .x-tip-ft {
   background: transparent url(../images/default/qtip/tip-sprite.gif) no-repeat 0 -18px;
   height:6px;
overflow:hidden;
}
.x-tip .x-tip-ft-left {
   background: transparent url(../images/default/qtip/tip-sprite.gif) no-repeat 0 -6px;
   padding-left:6px;
zoom:1;
}
.x-tip .x-tip-ft-right {
   background: transparent url(../images/default/qtip/tip-sprite.gif) no-repeat right -6px;
   padding-right:6px;
zoom:1;
}
.x-tip .x-tip-bd {
border:0 none;
font: normal 11px tahoma,arial,helvetica,sans-serif;
}
.x-tip .x-tip-bd-left {
   background: #fff url(../images/default/qtip/tip-sprite.gif) no-repeat 0 -24px;
   padding-left:6px;
zoom:1;
}
.x-tip .x-tip-bd-right {
   background: transparent url(../images/default/qtip/tip-sprite.gif) no-repeat right -24px;
   padding-right:6px;
zoom:1;
}

.x-tip h3 {
font: bold 12px tahoma,arial,helvetica,sans-serif;
margin:0;
padding:2px 2px;
color:#222;
}
.x-tip .x-tip-bd-inner {
margin:0 !important;
line-height:14px;
color:#222;
padding:0;
float:left;
}

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Dan Sorensen's Gravatar That's pretty cool! I wonder if the scripts load every time or only on the first visit. I don't want to see a day where every single page load is 1/4 meg. (unless everyone gets cable modem access)
# Posted By Dan Sorensen | 12/5/07 3:51 PM
Scott Bennett's Gravatar Whether or not your browser caches the files depends on how your browsers cache settings are set, but I believe that by default most browsers will cache them on the first page hit. This <i>is</i> a lot of JavaScript to load for just this one functionality, and you could probably write some JavaScript that does something similar but with less code, but most people that are using the Ext objects are not going to just use the Quicktips functionality, but will have other Ext powered functionality like the layouts , grids, date pickers, and stuff, and all of them rely on the same core js files. So for example, if you already are using cfgrid in your form, you wouldn't need to add all those script tags like I did, you could just add the one that gets qtips.js and it would work.

But you definitely need to know your audience, if you web analytics indicate that you have a sizable amount of dial up users you may want to work harder to make sure your site loads fast enough for them. I remember back in 1996 when I had dial up and I would click on a link and then walk away, then come back 5 minutes later and the page would still be loading.... I don't know how anyone could stand it.
# Posted By Scott Bennett | 12/5/07 5:54 PM
Dan G. Switzer, II's Gravatar @Scott / RE: Browser Caching

A recent Yahoo paper (I think you can find in on the Yahoo ySlow page) reported that contrary to popular belief, most web content is *not* cached. The paper had some interested numbers (which I can't recall offhand.) The point was basically don't assume your content is being cached by the browser.
# Posted By Dan G. Switzer, II | 12/5/07 7:10 PM
Scott Bennett's Gravatar @Dan,

Is this the article?

http://yuiblog.com/blog/2007/01/04/performance-res...

If I am reading it correctly (and I read it quickly so I may not be) it seems to say that in their experiment about 20% of the browsers to that page did not cache the image. That seems to imply that about 80% of the browsers are using a cached image after the initial page load.

I am not surprised that many users disable their caching, in fact that is one of the first things I do when I set up a new computer that I am going to be using. For me it is because I work on websites and don't want to have to clear my cache every time I make a change to a web page to see the results of my change. For other people it is simply a matter of privacy; perhaps they don't want others to see what kind of pages they browse on the internet.

In any case, I still believe (and I recognize my belief may not be firmly planted in reality, as I have not researched it thoroughly) that most commonly used browsers, set to their default cache settings, will cache these files.

If it was a different article you read, I would be interested in reading it, if you can find the link.
# Posted By Scott Bennett | 12/5/07 7:44 PM
Dave Ferguson's Gravatar This is great. You have no idea how long I have been trying to figure this out.

--Dave
# Posted By Dave Ferguson | 12/6/07 11:38 AM
frank's Gravatar This is a very quick and useful tag. You mentioned that the hide="user" will cause the tip to remain visible until the user manually closes it, or clicks on another element.
How about mouseout of the quicktip window? Is there a config option for it? Is there a config option for quicktip window to hide when mouse is out of the tip window?

thanks
# Posted By frank | 8/21/08 11:57 PM
Bill's Gravatar Nice tip! I had no idea that you could use the ext: qtip syntax for the input field. It would be great if Adobe put out some more complete documentation.
# Posted By Bill | 7/14/09 2:07 PM
https://www.bababorses.de/Louis-Vuitton-Damier-Ebene-Canvas-Clapton-PM-Bag-N44243-Magnolia-2361-it.html https://www.bababorses.de/Louis-Vuitton-LV-Trainer-Men-s-Sneakers-Top-Quality-15-5322-it.html https://www.bababorses.de/Celine-Small-Cabas-Bag-In-Black-Leather-it-2087 https://www.bababorses.de/Louis-Vuitton-Heel-10cm-Call-Back-Sandals-Nude-6162-it.html https://www.bababorses.de/LOUIS-VUITTON-BREA-MM-Monogram-Vernis-Leather-In-Magenta-4069-it.html https://www.bababorses.de/Louis-Vuitton-Ring-09-557-it.html https://www.bababorses.de/Louis-Vuitton-Monogram-LV-Square-Espadrilles-Slipper-Sandals-Brown-6371-it.html https://www.bababorses.de/Prada-Golden-Saffiano-Calfskin-Leather-Top-Handle-Bag-it-2956 https://www.bababorses.de/Dior-Diorissimo-Small-Bag-Black-Nappa-Leather-Silvery-Hardware-8001-it-22 https://www.bababorses.de/Louis-Vuitton-Idylle-Blossom-Charms-Necklace-Q94360-406-it.html https://www.bababorses.de/Louis-Vuitton-Color-Blossom-BB-Star-Pendant-Necklace-Red-Gold-309-it.html https://www.bababorses.de/Bvlgari-Serpenti-Original-Leather-Framed-Pochette-Sky-Blue-82121-it-1938 https://www.bababorses.de/Louis-Vuitton-Horizon-55-Trolley-Travel-Luggage-Bag-Taiga-Leather-M30331-Red-6892-it.html https://www.bababorses.de/Fendi-By-The-Way-Small-Croc-Satchel-White-it-2731 https://www.bababorses.de/Louis-Vuitton-Monogram-Canvas-and-PVC-Nano-Bag-M61114-3176-it.html https://www.bababorses.de/Louis-Vuitton-Sarah-Multicartes-Wallet-M61273-Hot-Pink-7624-it.html https://www.bababorses.de/louis-vuitton-speedy-30--Damier-Azur-Canvas-n44367-2300-it.html https://www.bababorses.de/Hermes-Birkin-35cm-cattle-skin-vein-Handbags-blue-golden-it-907 https://www.bababorses.de/Saint-Laurent-Baby-Sac-De-Jour-Bag-In-Rose-Grained-Leather-it-3322 https://www.bababorses.de/Louis-Vuitton-Twist-MM-M53531-M53532-2775-it.html https://www.bababorses.de/Louis-Vuitton-Sunglasses-133-978-it.html https://www.bababorses.de/Louis-Vuitton-Neverfull-MM-M54185-Black-2705-it.html https://www.bababorses.de/Prada-Saffiano-East-West-Medium-Tote-Bag-Nero-it-3042 https://www.bababorses.de/Louis-Vuitton-Compact-Wallet-in-Monogram-Canvas-M63041-7399-it.html https://www.bababorses.de/Prada-Mens-Leather-Pouch-3312-Black-it-3099 https://www.bababorses.de/Louis-Vuitton-Women-s-Escale-Lock-It-Flat-Mule-1A7TOX-Pink-5965-it.html https://www.bababorses.de/Fendi-Baguette-Micro-Monster-Bag-Purple-Multi-it-533 https://www.bababorses.de/Louis-Vuitton-LV-Angel-Stud-Earrings-M64293-435-it.html https://www.bababorses.de/Louis-Vuitton-Damier-Ebene-Canvas-Zippy-Wallet-Evasion-M61360-7219-it.html https://www.bababorses.de/LOUIS-VUITTON-CATOGRAM-SQUARE-SCARF-MP2266-4818-it.html https://www.bababorses.de/Louis-Vuitton-Monogram-Empreinte-Triangle-Shaped-Messenger-Bag-M54330-Black-3865-it.html https://www.bababorses.de/Balenciaga-Velo-Anthracite-store-it-1723 https://www.bababorses.de/Chloe-Marcie-Medium-Satchel-Bag-Cobalt-it-2283 https://www.bababorses.de/louis-vuitton-epi-leather-Soufflot-BB-bag-m55613-black-2580-it.html https://www.bababorses.de/Louis-Vuitton-Dauphine-MM-M55735-4512-it.html https://www.bababorses.de/Louis-Vuitton-Crafty-NeoNoe-MM-bag-black-M45497-2980-it.html https://www.bababorses.de/Louis-Vuitton-Men-Box-Bag-Shoulder-Body-Bag-M44157-Brown-3136-it.html https://www.bababorses.de/Prada-Saffiano-Double-Zip-Executive-Tote-Bag-Gray-it-3025 https://www.bababorses.de/Louis-Vuitton-Epi-Leather-NeoNoe-BB-Bucket-Bag-M53610-Indigo-2564-it.html https://www.bababorses.de/Saint-Laurent-Small-Monogram-Tassel-Satchel-In-Red-Crocodile-Leather-it-3158 https://www.bababorses.de/Louis-Vuitton-Iphone-Case-LV18-59-it.html https://www.bababorses.de/LOUIS-VUITTON--CLASSIC-MINI-PACKBACK-2872-it.html https://www.bababorses.de/Balenciaga-Velo-Anthracite-store-it-1723 https://www.bababorses.de/Louis-Vuitton-Monogram-Ebene-Canvas-Pegase-Legere-53-Business-Rolling-Luggage-6950-it.html https://www.bababorses.de/Louis-Vuitton-Crocodilien-Brillant-Capucines-Mini-Bag-N93429-Black-2231-it.html https://www.bababorses.de/Louis-Vuitton-Monogram-Hoodie-Jacket-Black-1526-it.html https://www.bababorses.de/Louis-Vuitton-Monogram-Coated-Canvas-Popincourt-PM-M43462--Raisin-3345-it.html https://www.bababorses.de/Louis-Vuitton-Lockme-Cabas-Tote-M55028-Black-4530-it.html https://www.bababorses.de/Givenchy-Antigona-Small-Leather-Satchel-Bag-Black-it-2432 https://www.bababorses.de/Louis-Vuitton-Monogram-Canvas-Small-Malle-Chain-Bag-3294-it.html https://www.bababorses.de/Louis-Vuitton-Epi-Leather-Zippy-Wallet-M62304-Red-7304-it.html https://www.bababorses.de/Louis-Vuitton-Iphone-Case-LV113-38-it.html https://www.bababorses.de/Louis-Vuitton-Heel-10.5cm-Eyeline-Pumps-Python-Pattern-Suede-Black-5999-it.html https://www.bababorses.de/LOUIS-VUITTON-PEGASE-LEGERE-REGATTA-N41620-MONOGRAM-CANVAS-6974-it.html https://www.bababorses.de/Louis-Vuitton-Kimono-Wallet-M56175-Pink-7437-it.html https://www.bababorses.de/Louis-Vuitton-Monogram-Tapestry-Denim-Bidart-Espadrilles-Blue-5726-it.html https://www.bababorses.de/Louis-Vuitton-Women-s-Escale-Shirtdress-Blue-1709-it.html https://www.bababorses.de/Louis-Vuitton-Montaigne-MM-M41048-Black-4597-it.html https://www.bababorses.de/Louis-Vuitton-Heel-10cm-Crystals-Call-Back-Sandals-Suede-Red-6160-it.html https://www.bababorses.de/Hermes-Bolide-31cm-Togo-Leather-Green-Bag-it-1070 https://www.bababorses.de/Replica-Hermes-Wallet-H001-Wallet-Cow-Leather-Green-it-1558 https://www.bababorses.de/Celine-Medium-Luggage-Tote-Black-Brown-White-Bag-it-2168 https://www.bababorses.de/Louis-Vuitton-Pochette-Voyage-MM-Bag-Damier-Graphite-Canvas-Pixel-N60176-Green-7278-it.html https://www.bababorses.de/Fendi-Black-Snake-Veins-Leather-With-Beige-Ferrari-Leather-Top-handle-Bag-it-469 https://www.bababorses.de/Louis-Vuitton-All-over-Monogram-Sleeveless-Belted-Dress-Navy-1375-it.html https://www.bababorses.de/Louis-Vuitton-Ring-02-560-it.html https://www.bababorses.de/Louis-Vuitton-Iphone-Case-LV32-76-it.html https://www.bababorses.de/Louis-Vuitton-Dauphine-MM-M55071-Blue-4511-it.html https://www.bababorses.de/Louis-Vuitton-Supreme-Iphone-Case-White-Red-212-it.html https://www.bababorses.de/Louis-Vuitton-Epi-Smooth-Leather-Twist-Shoulder-Bag-MM-Pink-Black-2639-it.html https://www.bababorses.de/Louis-Vuitton-Monogram-Empreinte-Leather-Cosmetic-Pouch-Bag-M80502-Bouton-de-Rose-Pink-By-The-Pool-Capsule-Collection-4296-it.html https://www.bababorses.de/Louis-Vuitton-Bracelet-21-271-it.html https://www.bababorses.de/Louis-Vuitton-Heel-9.5-cm-Star-Trail-Ankle-Boots-Black-5511-it.html https://www.bababorses.de/Louis-Vuitton-Geronimos-Belt-Bag-M43502-Black-Epi-Leather-2646-it.html https://www.bababorses.de/Louis-Vuitton-Damier-Ebene-Canvas-Vavin-Chain-Wallet-N60222-Bordeaux-Red-7221-it.html https://www.bababorses.de/Louis-Vuitton-Monogram-Empreinte-Leather-Zippy-Coin-Purse-M80408-Cream-Saffron-By-The-Pool-Capsule-Collection-7741-it.html https://www.bababorses.de/Louis-Vuitton-Vintage-Monogram-Vernis-Bleecker-Box-Top-Handle-Bag-Burgundy-4172-it.html https://www.bababorses.de/Prada-Saffiano-Mini-Galleria-Crossbody-Bag-Beige-it-2708 https://www.bababorses.de/Louis-Vuitton-Sunglasses-39-1042-it.html https://www.bababorses.de/Louis-Vuitton-Monogram-Canvas-Leopard-Print-Onthego-Tote-Bag-M44674-Black-White-3232-it.html https://www.bababorses.de/Louis-Vuitton-Epi-Leather-Twist-PM-Bag-with-Crystal-embellished-Chain-M55412-White-2630-it.html https://www.bababorses.de/Fendi-Chameleon-Red-Cross-Veins-Leather-Tote-Bag-it-488 https://www.bababorses.de/Louis-Vuitton-Monogram-Canvas-Onthego-Tote-Bag-M44571-Kaki-3270-it.html https://www.bababorses.de/Fendi-Earth-Yellow-Leather-with-Multicolor-Striped-Fabric-Shopping-Handbag-it-771 https://www.bababorses.de/Louis-Vuitton-Croco-Pattern-Petite-Boite-Chapeau-Bag-Black-4090-it.html https://www.bababorses.de/Prada-Saffiano-Small-Double-Handle-Tote-Bag-Light-Gray-Pomice-it-2849 https://www.bababorses.de/Louis-Vuitton-Lvxlol-Speedy-BB-M45202-Golden-3125-it.html https://www.bababorses.de/Louis-Vuitton-Gloria-Flat-Open-Back-Loafers-Monogram-Canvas-5798-it.html https://www.bababorses.de/LOUIS-VUITTON-BREA-PM-Monogram-Vernis-leather-IN-MORDORE-4074-it.html https://www.bababorses.de/Replica-Hermes-Steve-H2810-Ladies-Shoulder-Bag-Cow-Leather-it-1428 https://www.bababorses.de/Louis-Vuitton-Noe-bag-M42226-Brown-3496-it.html https://www.bababorses.de/Louis-Vuitton-Damier-Azur-Canvas-I-2260-it.html https://www.bababorses.de/Christian-Dior-Multicolor-PeachYellow-Zipper-Wallet-118-it-223 https://www.bababorses.de/Fendi-By-the-Way-Small-Tricolor-Satchel-Bag-it-2916 https://www.bababorses.de/Prada-Medium-Vitello-Diano-Open-Tote-Bag-Pomice-it-2728 https://www.bababorses.de/Luxury-Hermes-Wallet-H001-Unisex-Wallet-it-1598 https://www.bababorses.de/Louis-Vuitton-Iphone-Case-LV42-104-it.html https://www.bababorses.de/Prada-Saffiano-Small-Gardeners-Tote-Bag-Blue-it-2803 https://www.bababorses.de/Louis-Vuitton-Sac-Tricot-Bag-Epi-Leather-Red-M52805-2736-it.html https://www.bababorses.de/Louis-Vuitton-Crazy-in-Lock-Strass-Bracelet-Silver-316-it.html