Changeset 2334
- Timestamp:
- 07/13/07 03:34:03 (1 year ago)
- Location:
- trunk/plugins/cluetip
- Files:
-
- 3 modified
-
demo/demo.js (modified) (2 diffs)
-
demo/index.html (modified) (5 diffs)
-
jquery.cluetip.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/cluetip/demo/demo.js
r2263 r2334 16 16 $('a.load-local').cluetip({local:true}); 17 17 $('#clickme').cluetip({activation: 'click'}); 18 $('span[@title]').css('background', 'yellow').cluetip({splitTitle: '|'}); 19 18 20 }); 19 21 20 22 21 23 22 //unrelated to clueTip -- just for th ispage...24 //unrelated to clueTip -- just for the demo page... 23 25 $(document).ready(function() { 24 26 $('#container > div').hide().append('<a class="back-to-top" href="#top">back to top</a>'); … … 30 32 $('#navigation a').removeClass('active'); 31 33 $this.addClass('active'); 34 return false; 32 35 }); 33 36 }); -
trunk/plugins/cluetip/demo/index.html
r2263 r2334 28 28 <div id="container"> 29 29 30 <p>This is a demo pagefor the new clueTip — a jQuery-based, AJAX-powered tooltip developed by <a href="http://www.learningjquery.com/">Karl Swedberg</a>. The clueTip plug-in was inspired by <a href="http://www.codylindley.com">Cody Lindley</a>'s jTip script. Many feature ideas were provided by Shelane Enos and Glen Lipka. <a href="http://www.tweaktheviking.com">Jonathan Chaffer</a> helped a lot, but eschewed the co-author designation out of sheer modesty. </p>30 <p>This is a <span title="foo|bar|baz">demo page</span> for the new clueTip — a jQuery-based, AJAX-powered tooltip developed by <a href="http://www.learningjquery.com/">Karl Swedberg</a>. The clueTip plug-in was inspired by <a href="http://www.codylindley.com">Cody Lindley</a>'s jTip script. Many feature ideas were provided by Shelane Enos and Glen Lipka. <a href="http://www.tweaktheviking.com">Jonathan Chaffer</a> helped a lot, but eschewed the co-author designation out of sheer modesty. </p> 31 31 <div id="features"> 32 32 <h3>Features</h3> … … 39 39 <p>The clueTip offers smart positioning:</p> 40 40 <ul> 41 <li>uses the excellent <a href="http://jqueryjs.googlecode.com/svn/trunk/plugins/dimensions/">Dimensions Plugin</a> for all of its positioning needs</li> 41 42 <li>switches from the right side of the link to the left side, if there is not enough room between the link and the right edge of the browser window </li> 42 <li>moves up until the whole clueTip is visible, if the link is too close close to the bottom edge of the browser window.</li> 43 <li>moves up until the whole clueTip is visible, if the link is too close to the bottom edge of the browser window.</li> 44 <li>moves back down until the clueTip's top is at the top edge of the browser window, if the clueTip is taller than the window (viewport)</li> 43 45 <li>sits to the right or left of the mouse position, if the link is a block-level element or if the link is so wide that the clueTip can't completely fit to the left or the right of it.</li> 44 46 </ul> 47 45 48 <p>The clueTip takes advantage of Brian Cherne's fantastic <a href="http://cherne.net/brian/resources/jquery.hoverIntent.html" title="hoverIntent jQuery Plug-in">hoverIntent plugin</a> if it's available. (Just include it in a <script> tag if you want the clueTip to use it.)</p> 46 49 <p>The clueTip comes with the following options: </p> 47 50 <ul> 48 <li><strong><code>width</code></strong>: default is <code>275</code>;</li> 51 <li><strong><code>width</code></strong>: default is <code>275</code></li> 52 <li><strong><code>local</code></strong>: default is <code>false</code>; set to <code>true</code> to use an element on the current page for the contents of the clueTip. 53 </li> 54 <li><strong><code>hideLocal</code></strong>: default is <code>true</code>. If the <code>local</code> option is set to true, this one determines whether local content to be shown in clueTip should be hidden at its original location. 49 55 <li><strong><code>attribute</code></strong>: default is <code>'rel'</code>; set it to some other attribute of the link to designate that attribute as the one that refers to the clueTip's content</li> 50 56 <li><strong><code>titleAttribute</code></strong>: default is <code>'title'</code>; set it to another attribute to use its text for the clueTip's title</li> 57 <li><strong><code>splitTitle</code></strong>: default is an empty string; set to a character such as "|" to split the title attribute of a link into the clueTip heading (the first string, before the first delimiter character) and individual clueTip body divs (subsequent strings).</li> 58 <li><strong><code>hoverClass</code></strong>: default is an empty string; set to the name of the class to add that class to the link on hover</li> 59 <li><strong><code>waitImage</code></strong>: default is <code>'wait.gif'</code>; <em>not implemented yet</em></li> 51 60 <li><strong><code>sticky</code></strong>: default is <code>false</code>; set to <code>true</code> if you want the clueTip to remain open when you "mouse out" of the link. This option also places a "close" link on the clueTip itself. </li> 61 <li><strong><code>activation</code></strong>: default is 'hover'; set to 'toggle' to force the user to click the element in order to activate the clueTip.</li> 52 62 <li><strong><code>closePosition</code></strong>: default is <code>'top'</code>; set to <code>'bottom'</code> to put the 'close' link at the bottom of the clueTip. Additional formatting can be applied to <code>a#cluetip-close</code> in the style sheet.</li> 53 63 <li><strong><code>closeText</code></strong>: default is <code>'Close'</code>; set it to something else if you want to</li> 54 <li><strong><code>hoverClass</code></strong>: default is an empty string; set to the name of the class to add that class to the link on hover</li>55 <li><strong><code>loadImage</code></strong>: default is <code>'wait.gif'</code>; <em>not implemented yet</em></li>56 64 <li><strong><code>truncate</code></strong>: default is <code>0</code>, which means there will be no truncation; set it to some number to truncate the clueTip's contents to <code>n</code> characters</li> 65 <li><strong><code>pngFix</code></strong>: default is true; fixes png transparency for the clueTip in IE<=6. change to false to disable it.</li> 66 <li><strong><code>hoverIntent</code></strong>: default is true; if jquery.hoverintent.js plugin is included in <code><head></code>, <code>.hoverIntent()</code> will be used instead of <code>.hover()</code></li> 57 67 <li><strong><code>ajaxProcess</code></strong>: default is: 58 68 <pre><code>function(data) {data = $(data).not('style, meta, link, script, title'); 59 69 return data; 60 70 }</code></pre> 61 This default value strips out tags from the <head>of an HTML page that is being pulled into a clueTip via "AHAH."</li>71 This default value strips out tags from the <code><head></code> of an HTML page that is being pulled into a clueTip via "AHAH."</li> 62 72 <li><strong><code>ajaxSettings</code></strong>: default is <code> {dataType: 'html'}</code>. You can use any argument here that you would use in <code>$.ajax()</code>. </li> 63 <li><strong><code>local</code></strong>: default is <code>false</code>; set to <code>true</code> to use an element on the current page for the contents of the clueTip.64 </li>65 <li><strong><code>splitTitle</code></strong>: default is an empty string; set to a character such as "|" to split the title attribute of a link into the clueTip heading (the first string, before the first delimiter character) and individual clueTip body divs (subsequent strings).</li>66 73 </ul> 67 74 </div> … … 158 165 <div id="known-issues"> 159 166 <h3>Known Issues and To Do</h3> 167 <p>I've pretty much completed all the things I wanted to do with the plugin. If there is something that you think needs to be included, or if you find something that's broken or just not working as you expect it to, post a message on the jQuery discussion list.</p> 160 168 <ul> 161 169 <li><del>Allow clueTips to load content from same page.</del> Done!</li> … … 163 171 <li><del>Optimize ajax loading to avoid multiple requests for the same clueTip content.</del> Done!</li> 164 172 <li><del>Allow clueTips to take advantage of Brian Cherne's hoverIntent plugin</del> Done!</li> 165 <li> Include some kind of .png alpha transparency fix for IE 6 and under.</li>173 <li><del>Include some kind of .png alpha transparency fix for IE 6 and under.</del> Done! </li> 166 174 </ul> 167 175 </div> … … 170 178 <p>ClueTip</p> 171 179 <ul> 172 <li><a href="http://jqueryjs.googlecode.com/svn/trunk/plugins/cluetip/">clueTip files</a> in jQuery's SVN repository : includes <a href="http://jqueryjs.googlecode.com/svn/trunk/plugins/cluetip/" title="Revision 2262: /trunk/plugins/cluetip/jquery.cluetip.js">jquery.cluetip.js</a>, demo files, and all dependencies.</li>180 <li><a href="http://jqueryjs.googlecode.com/svn/trunk/plugins/cluetip/">clueTip files</a> in jQuery's SVN repository : includes <a href="http://jqueryjs.googlecode.com/svn/trunk/plugins/cluetip/">jquery.cluetip.js</a>, demo files, and all dependencies.</li> 173 181 <li><a href="http://examples.learningjquery.com/62/demo/">clueTip demo</a> on learningjquery.com</li> 174 182 </ul> 175 183 <p>Dependencies</p> 176 184 <ul> 177 <li><a href="http://jqueryjs.googlecode.com/svn/trunk/plugins/dimensions/">Dimensions Plugin</a> Dimensions filein jQuery's SVN repository : includes <a href="http://jqueryjs.googlecode.com/svn/trunk/plugins/dimensions/" title="Revision 2262: /trunk/plugins/dimensions">jquery.dimensions.js</a>, as well as minified and packed versions. </li>185 <li><a href="http://jqueryjs.googlecode.com/svn/trunk/plugins/dimensions/">Dimensions Plugin</a> in jQuery's SVN repository : includes <a href="http://jqueryjs.googlecode.com/svn/trunk/plugins/dimensions/" title="Revision 2262: /trunk/plugins/dimensions">jquery.dimensions.js</a>, as well as minified and packed versions. </li> 178 186 <li><a href="http://jquery.com/src/jquery-latest.js">jquery.js</a> : latest stable release</li> 179 187 <li><a href="http://cherne.net/brian/resources/jquery.hoverIntent.html" title="hoverIntent jQuery Plug-in">hoverIntent Plugin</a> (optional) on Brian Cherne's web site : includes demos and source file.</li> -
trunk/plugins/cluetip/jquery.cluetip.js
r2263 r2334 1 1 /* 2 2 * jQuery clueTip plugin 3 * Version 0. 5 (07/07/2007)3 * Version 0.6 (07/12/2007) 4 4 * @depends jQuery v1.1.1 5 5 * @depends Dimensions plugin … … 63 63 * @option String splitTitle: default is '' (empty string). A character used to split the title attribute into the clueTip title and divs within the clueTip body; if used, the clueTip will be populated only by the title attribute, 64 64 * @option String hoverClass: default is empty string. designate one to apply to the hovered element 65 * @option String waitImage: default is 'wait.gif'65 * @option String FIXME: waitImage: default is 'wait.gif' 66 66 * @option Boolean sticky: default is false. Set to true to keep the clueTip visible until the user either closes it manually by clicking on the CloseText or display another clueTip. 67 67 * @option String activation: default is 'hover'. Set to 'toggle' to force the user to click the element in order to activate the clueTip. … … 145 145 var $this = $(this); 146 146 var tipAttribute = $this.attr(defaults.attribute); 147 if (!tipAttribute ) return true;147 if (!tipAttribute && !defaults.splitTitle) return true; 148 148 149 149 // if hideLocal is set to true, initially hide the local content that will be displayed in the clueTip … … 297 297 }; 298 298 cluetipShow(pY); 299 300 299 301 300 /***************************************
