Bug Tracker

Changeset 2437

Show
Ignore:
Timestamp:
07/21/07 02:49:01 (1 year ago)
Author:
kswedberg
Message:

fixed problem in Safari when triggering cluetip from an "area" element
added 'fx' option.

Location:
trunk/plugins/cluetip
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/plugins/cluetip/demo/alt-demo.html

    r2416 r2437  
    2727  </ul> 
    2828  <div id="container"> 
    29  
    30     <p>This is a demo page for the new clueTip &mdash; 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. Glen Lipka and Jörn Zaefferer provided expert advice. <a href="http://www.tweaktheviking.com">Jonathan Chaffer</a> helped a lot, but eschewed the co-author designation out of sheer modesty. </p> 
     29    <p>This is a demo page for the new clueTip &mdash; 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. <a href="http://commadot.com/">Glen Lipka</a> and <a href="http://bassistance.de/">Jörn Zaefferer</a> provided expert advice. <a href="http://www.tweaktheviking.com">Jonathan Chaffer</a> helped a lot, but eschewed the co-author designation out of sheer modesty. </p> 
    3130    <p style="padding: .5em; border: 2px solid #ccc">This page uses the <a href="http://www.codylindley.com/blogstuff/js/jtip/">jTip</a> style for the clueTips. </p> 
    3231    <div id="features"> 
     
    173172      <li><del>Optimize ajax loading to avoid multiple requests for the same clueTip content.</del> Done!</li> 
    174173      <li><del>Allow clueTips to take advantage of Brian Cherne's hoverIntent plugin</del> Done!</li> 
    175       <li><del>Include some kind of .png alpha transparency fix for IE 6 and under.</del> Done! </li> 
     174      <li><del>Include some kind of .png alpha transparency fix for IE 6 and under.</del> Abandoned in favor of divs with reduced opacity </li> 
    176175    </ul> 
    177176    </div> 
  • trunk/plugins/cluetip/demo/index.html

    r2416 r2437  
    2828  <div id="container"> 
    2929 
    30     <p>This is a demo page for the new clueTip &mdash; 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 demo page for the new clueTip &mdash; 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. <a href="http://commadot.com/">Glen Lipka</a> and <a href="http://bassistance.de/">Jörn Zaefferer</a> provided expert advice. <a href="http://www.tweaktheviking.com">Jonathan Chaffer</a> helped a lot, but eschewed the co-author designation out of sheer modesty. </p> 
    3131    <div id="features"> 
    3232    <h3>Features</h3> 
     
    163163      <li><del>Optimize ajax loading to avoid multiple requests for the same clueTip content.</del> Done!</li> 
    164164      <li><del>Allow clueTips to take advantage of Brian Cherne's hoverIntent plugin</del> Done!</li> 
    165       <li><del>Include some kind of .png alpha transparency fix for IE 6 and under.</del> Done! </li> 
     165      <li><del>Include some kind of .png alpha transparency fix for IE 6 and under.</del> Abandoned in favor of divs with reduced opacity </li> 
    166166    </ul> 
    167167    </div> 
  • trunk/plugins/cluetip/jquery.cluetip.css

    r2414 r2437  
    11#cluetip { 
    2   z-index: 1001; 
     2  position: absolute; 
     3/*  z-index: 1001;*/ 
     4  background: #d9d9c2; 
    35} 
    46#cluetip-outer { 
  • trunk/plugins/cluetip/jquery.cluetip.js

    r2416 r2437  
    100100      closeText: 'Close', 
    101101      truncate: 0, 
     102      fx: { 
     103        open: 'fadeIn', 
     104        openSpeed: 'fast', 
     105        close: 'hide', 
     106        closeSpeed: '' 
     107      }, 
    102108      arrows: false, // CHANGE THIS TO true IF YOU WANT jTip-STYLE ARROWS FOR ALL clueTips 
    103109      dropShadow: true, 
     
    130136        $cluetip = $('<div></div>') 
    131137          .attr({'id': 'cluetip'}) 
     138          .css({zIndex: 1002}) 
    132139        .append($cluetipOuter) 
    133140        .appendTo('body') 
     
    135142        $('<img src="' + defaults.waitImage + '" />') 
    136143          .attr({'id': 'cluetip-waitimage'}) 
    137           .css({position: 'absolute', zIndex: '1001'}) 
     144          .css({position: 'absolute', zIndex: 1001}) 
    138145        .appendTo('body') 
    139146        .hide(); 
    140         var cluezIndex = $cluetip.css('zIndex') != 'auto' ? $cluetip.css('zIndex') : '1002'; 
     147        var cluezIndex = $cluetip.css('zIndex') != 'auto' ? parseInt($cluetip.css('zIndex'), 10) : 1002; 
    141148        $cluetip.css({position: 'absolute', zIndex: cluezIndex}); 
    142149        $cluetipOuter.css({position: 'relative', zIndex: +cluezIndex+1}); 
     
    149156        }; 
    150157        $dropShadow.css({position: 'absolute', backgroundColor: '#000'}) 
    151           .appendTo($cluetip); 
     158          .prependTo($cluetip); 
    152159      } 
     160 
    153161      var $this = $(this);       
    154162      var tipAttribute = $this.attr(defaults.attribute); 
     
    176184      var cluetipClose = function() { 
    177185        $cluetipOuter  
    178         .children().empty().end() 
    179         .parent().hide(); 
     186        .parent()[defaults.fx.close](defaults.fx.closeSpeed).end() 
     187        .children().empty(); 
    180188        if (tipTitle) { 
    181189          $this.attr('title', tipTitle); 
     
    224232          $cluetip.css({backgroundPosition: bgPos}); 
    225233        } 
    226          
    227         $cluetip.show();        
     234        
     235        $cluetip.hide()[defaults.fx.open](defaults.fx.openSpeed); 
    228236      }; 
    229237 
     
    270278          $this.addClass(defaults.hoverClass); 
    271279        } 
    272          
    273         sTop = $(document).scrollTop(); 
    274         offTop = $this.offset().top; 
    275         offLeft = $this.offset().left; 
    276         winWidth = $(window).width(); 
    277         posX = (offWidth > offLeft && offLeft > tipWidth) 
    278           || offLeft + offWidth + tipWidth > winWidth  
    279           ? offLeft - tipWidth - 15  
    280           : offWidth + offLeft + 15; 
    281         posY = offTop; 
    282   
     280        if ($this[0].tagName.toLowerCase() != 'area') { 
     281          sTop = $(document).scrollTop(); 
     282          offTop = $this.offset().top; 
     283          offLeft = $this.offset().left; 
     284          winWidth = $(window).width(); 
     285          posX = (offWidth > offLeft && offLeft > tipWidth) 
     286            || offLeft + offWidth + tipWidth > winWidth  
     287            ? offLeft - tipWidth - 15  
     288            : offWidth + offLeft + 15; 
     289          posY = offTop; 
     290        } 
    283291        $cluetip.css({width: defaults.width}); 
     292 
    284293        if ($this.css('display') != 'block' && posX >=0 && $this[0].tagName.toLowerCase() != 'area') { 
    285294          $cluetip.css({left: posX + 'px'});