2016-07-22 4 views
0

jQuery UIツールチップを使用していますが、いくつかの画像にカーソルを合わせると有効になります。私はこの質問に絵を付けました。ピンクの後に見える白い余白は余分です。それがなぜ形成されているのか? 私はそれの背後にある理由を得るために過去数時間苦労しています。 tooltip example `HTML:これは私のHTMLコンテンツ です:jQuery UI ToolTip余分な幅の問題

CSS: My CSS rules 
.ui-tooltip { 
     padding: 1em; 
     border: 2px solid $colorBrown; 
     color: $colorBrown; 
     margin: 0; 
    } 

    .ui-tooltip-content { 
     padding: 1em; 
     color: $colorWhite; 
     background: $colorBrown; 
    } 

    .ui-tooltip-content::after { 
     content: ''; 
     position: absolute; 
     border-style: solid; 
     display: block; 
     color: $colorBrown; 
    } 

    .top .ui-tooltip-content::after { 
     bottom: -10px; 
     left: 70px; 
     border-color: $colorBrown transparent; 
     border-width: 10px 10px 0; 
    } 

    JS: The JS function that initiates tooltip 
    function toolTipInit() { 
     $('.social-icons span').tooltip({ 
      items: 'a.whatsapp, a.skype', 
      content: function() { 
       return $(this).data('content'); 
      }, 
      show: null, 
      position: { 
       my: 'center bottom', 
       at: 'center top-50' 
      }, 
      tooltipClass: 'top', 
      open: function(event, ui) { 
       if (typeof(event.originalEvent) === 'undefined') { 
        return false; 
       } 
      }, 
      close: function(event, ui) { 
       ui.tooltip.hover(function() { 
         $(this).stop(true).fadeTo(400, 1); 
        }, 
        function() { 
         $(this).fadeOut('400', function() { 
          $(this).remove(); 
         }); 
        }); 
      } 
     }); 
    } 
    ` 
+0

私はあなたがあなたの質問で参照画像が表示されません。もう一度追加できますか? –

+0

申し訳ありません。私は今写真を添付し​​ています。 –

答えて

0

使用カスタムCSSで重要なことは、デフォルトのUIのCSSを上書きすることができるように!。私はそれが助けると思う。

例:

padding:0 !important; 
+0

私はどのように愚かなことができますか?私はこれを何年も働いてきましたが、これらの基本的なことにこだわっています。とにかく、!重要な仕事はうまくいった。どうもありがとうございました:) –

+0

いつか起こります:) 正しい答えに尋ねて投票してください。P –

+0

ええ、それはときどき起こります。一度スタックオーバーフローが起これば、私はそれを投票することができます。 –

関連する問題