Changeset 4511
- Timestamp:
- 01/22/08 22:36:19 (1 year ago)
- Location:
- trunk/plugins/cluetip
- Files:
-
- 1 added
- 4 modified
-
Changelog.txt (modified) (1 diff)
-
demo/demo.js (modified) (1 diff)
-
demo/index.html (modified) (1 diff)
-
jquery-1.2.2.min.js (added)
-
jquery.cluetip.js (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/cluetip/Changelog.txt
r3829 r4511 1 1 2 2 == New and Noteworthy == 3 4 == 0.9.5 == 5 6 * added clickThrough option to allow click to go to page, even if href and tipAttribute are equal. 7 * added experimental mouse tracking option 8 * added simple/experimental delayedClose option to allow auto-closing of clueTip after given number of milliseconds. 9 * added "focus" as an available value for "activation" option. Will show clueTip on focus of a form element, hide on blur. 10 * added support for bgiframe plugin. When the bgiframe plugin is referenced in the docuement, clueTip will use it (in IE6). 11 * cleaned up default ajaxProcess option. 12 * provided public access to all default plugin settings (thanks malsup!) 13 * fixed bug (reported at http://jquery.com/plugins/node/941) when splitTitle is used and title attribute is empty 14 * fixed bug where a variable was improperly nested in an if statement 15 * fixed bug with incorrectly disabling link when no href is present in invoking element 16 * fixed annoyance (reported at http://plugins.jquery.com/node/1081): default title attributes showing before cluetip when using long interval in hoverIntent. 3 17 4 18 == 0.9.3 == -
trunk/plugins/cluetip/demo/demo.js
r3932 r4511 1 1 2 2 /* the next line is an example of how you can override default options globally (currently commented out) ... */ 3 // $.fn.cluetip.defaults.sticky = true; 3 4 // $.fn.cluetip.defaults.tracking = true; 4 5 5 6 $(document).ready(function() { -
trunk/plugins/cluetip/demo/index.html
r3932 r4511 7 7 <title>clueTip : A jQuery Plugin</title> 8 8 9 <script src="../jquery .js" type="text/javascript"></script>9 <script src="../jquery-1.2.2.min.js" type="text/javascript"></script> 10 10 <script src="../jquery.dimensions.js" type="text/javascript"></script> 11 11 <script src="../jquery.hoverIntent.js" type="text/javascript"></script> -
trunk/plugins/cluetip/jquery.cluetip.js
r4039 r4511 1 1 /* 2 2 * jQuery clueTip plugin 3 * Version 0.9. 3.2 (12/05/2007)3 * Version 0.9.5 (01/22/2008) 4 4 * @requires jQuery v1.1.1+ 5 5 * @requires Dimensions plugin … … 56 56 * More examples can be found at http://plugins.learningjquery.com/cluetip/demo/ 57 57 * 58 * Full list of options/settings can be found at the bottom of this file 58 * Full list of options/settings can be found at the bottom of this file and at http://plugins.learningjquery.com/cluetip/ 59 59 */ 60 60 … … 83 83 var cluetipContents = false; 84 84 var cluezIndex = parseInt(opts.cluezIndex, 10)-1; 85 var isActive = false ;86 85 var isActive = false, closeOnDelay = 0; 86 87 87 // create the cluetip divs 88 88 if (!$cluetip) { … … 90 90 $cluetipTitle = $('<h3 id="cluetip-title"></h3>'); 91 91 $cluetipOuter = $('<div id="cluetip-outer"></div>').append($cluetipInner).prepend($cluetipTitle); 92 $cluetip = $('<div ></div>').attr({'id': 'cluetip'}).css({zIndex: opts.cluezIndex})92 $cluetip = $('<div id="cluetip"></div>').css({zIndex: opts.cluezIndex}) 93 93 .append($cluetipOuter).append('<div id="cluetip-extra"></div>')[insertionType](insertionElement).hide(); 94 94 $('<div id="cluetip-waitimage"></div>').css({position: 'absolute', zIndex: cluezIndex-1}) … … 116 116 var tipHeight, wHeight; 117 117 var defHeight = isNaN(parseInt(opts.height, 10)) ? 'auto' : (/\D/g).test(opts.height) ? opts.height : opts.height + 'px'; 118 var sTop, linkTop, posY, tipY, mouseY ;118 var sTop, linkTop, posY, tipY, mouseY, baseline; 119 119 // horizontal measurement variables 120 120 var tipWidth = parseInt(opts.width, 10) + parseInt($cluetip.css('paddingLeft')) + parseInt($cluetip.css('paddingRight')) + dropShadowSteps; … … 127 127 var tipTitle = (opts.attribute != 'title') ? $this.attr(opts.titleAttribute) : ''; 128 128 if (opts.splitTitle) { 129 if(tipTitle == undefined) {tipTitle = '';}129 if(tipTitle == undefined) {tipTitle = '';} 130 130 tipParts = tipTitle.split(opts.splitTitle); 131 131 tipTitle = tipParts.shift(); 132 132 } 133 133 var localContent; 134 134 135 135 136 /*************************************** … … 187 188 ***************************************/ 188 189 if (tipParts) { 189 for (var i=0; i < tipParts.length; i++){ 190 var tpl = tipParts.length; 191 for (var i=0; i < tpl; i++){ 190 192 if (i == 0) { 191 193 $cluetipInner.html(tipParts[i]); … … 211 213 if (opts.waitImage) { 212 214 $('#cluetip-waitimage') 213 .css({top: mouseY+20, left: mouseX })215 .css({top: mouseY+20, left: mouseX+20}) 214 216 .show(); 215 217 } … … 283 285 $cluetipOuter.css({overflow: defHeight == 'auto' ? 'visible' : 'auto', height: defHeight}); 284 286 tipHeight = defHeight == 'auto' ? $cluetip.outerHeight() : parseInt(defHeight,10); 285 tipY = posY; 287 tipY = posY; 288 baseline = sTop + wHeight; 286 289 if (opts.positionBy == 'fixed') { 287 290 tipY = posY - opts.dropShadowSteps + tOffset; 288 291 } else if ( (posX < mouseX && Math.max(posX, 0) + tipWidth > mouseX) || opts.positionBy == 'bottomTop') { 289 if (posY + tipHeight + tOffset > sTop + wHeight&& mouseY - sTop > tipHeight + tOffset) {292 if (posY + tipHeight + tOffset > baseline && mouseY - sTop > tipHeight + tOffset) { 290 293 tipY = mouseY - tipHeight - tOffset; 291 294 direction = 'top'; … … 294 297 direction = 'bottom'; 295 298 } 296 } else if ( posY + tipHeight + tOffset > sTop + wHeight) {297 tipY = (tipHeight >= wHeight) ? sTop : sTop + wHeight- tipHeight - tOffset;299 } else if ( posY + tipHeight + tOffset > baseline ) { 300 tipY = (tipHeight >= wHeight) ? sTop : baseline - tipHeight - tOffset; 298 301 } else if ($this.css('display') == 'block' || $this[0].tagName.toLowerCase() == 'area' || opts.positionBy == "mouse") { 299 302 tipY = bpY - tOffset; … … 317 320 if (opts.dropShadow) $dropShadow.css({height: tipHeight, width: opts.width}).show(); 318 321 if ($.fn.bgiframe) { $cluetip.bgiframe(); } 319 // trigger the optional onShow function 322 // trigger the optional onShow function 323 if (opts.delayedClose > 0) { 324 closeOnDelay = setTimeout(cluetipClose, opts.delayedClose); 325 } 326 320 327 opts.onShow($cluetip, $cluetipInner); 328 321 329 }; 322 330 … … 329 337 if (!opts.sticky || (/click|toggle/).test(opts.activation) ) { 330 338 cluetipClose(); 339 clearTimeout(closeOnDelay); 331 340 }; 332 341 if (opts.hoverClass) { … … 390 399 }; 391 400 if ($.fn.hoverIntent && opts.hoverIntent) { 392 $this.hoverIntent({ 401 $this.mouseover(function() {$this.attr('title',''); }) 402 .hoverIntent({ 393 403 sensitivity: opts.hoverIntent.sensitivity, 394 404 interval: opts.hoverIntent.interval, … … 454 464 clickThrough: false, // if true, and activation is not 'click', then clicking on link will take user to the link's href, 455 465 // even if href and tipAttribute are equal 456 tracking: false, // if true, clueTip will track mouse movement 466 tracking: false, // if true, clueTip will track mouse movement (experimental) 467 delayedClose: 0, // close clueTip on a timed delay (experimental) 457 468 closePosition: 'top', // location of close text for sticky cluetips; can be 'top' or 'bottom' or 'title' 458 469 closeText: 'Close', // text (or HTML) to to be clicked to close sticky clueTips … … 483 494 // process data retrieved via xhr before it's displayed 484 495 ajaxProcess: function(data) { 485 data = $(data).not('style, meta, link, script, title');496 data = data.replace(/<s(cript|tyle)(.|\s)*?\/s(cript|tyle)>/g, '').replace(/<link(.|\s)*?\/link>/g,''); 486 497 return data; 487 498 }, … … 492 503 } 493 504 }; 494 505 495 506 496 507 /*
