2016-04-07 12 views
0

私はCRM(drupal)とモバイルのツールチップを使用しているWebサイトで働いています。私は再びそれをクリックすると隠す方法がわかりません。これはウェブサイトですhttp://www.cfb.it serviziのセクションのツールチップは、しかし、私は電話(私はiPhoneとサムスンを試してみました)からウェブサイトにアクセスしようとすると、それをクリックするとツールチップが表示されますが、それをクリックすると再び隠すことはできません。ツールチップを隠すには?

ここにこのツールチップのjqueryコードがありますが、何が欠けているのか分かりません。

(function($) { 

    $(document).ready(function() { 

    function tooltipInit() { 
       var tooltip = jQuery('.tooltip'), 
        target = jQuery('.icon'), 
        arrow = jQuery('.arrow-down'), 
        mobile = jQuery(window).width() < 960, 
        desktop = jQuery(window).width() > 960 
       if (mobile) { 
        jQuery(".overview:odd").addClass('pull-left'); 
        target.click(function() { 
         target.css({ 
          "background-position": "top" 
         }); 
         jQuery(this).css({ 
          "background-position": "bottom" 
         }); 
         tooltip.removeClass('visible'); 
         arrow.removeClass('visible'); 
         jQuery(this).siblings('.tooltip, .arrow-down, .details').addClass('visible'); 
         $this = $(this); 
         $this.parents('.icons').find('.details').removeClass('mobile-show'); 
         $this.find('.details').addClass('mobile-show'); 
        }); 
        tooltip.click(function() { 
         jQuery(this).removeClass('visible'); 
         jQuery(this).siblings('.arrow-down').removeClass('visible'); 
         jQuery(this).siblings('.icon').css({ 
          "background-position": "top" 
         }); 
        }); 
        target.unbind('mouseenter'); 
        target.unbind('mouseleave'); 
       } 
       if (desktop) { 
        jQuery('.pull-left').removeClass('pull-left'); 
        target.css({ 
         "background-position": "top" 
        }) 
        tooltip.removeClass('visible'); 
        arrow.removeClass('visible'); 
        target.bind('mouseenter', function() { 
         jQuery(this).siblings('.tooltip, .arrow-down').addClass('visible'); 
         jQuery(this).css({ 
          "background-position": "bottom" 
         }); 
         var removeTooltip = function() { 
          tooltip.removeClass('visible'); 
          arrow.removeClass('visible'); 
         }; 
         target.bind('mouseleave', removeTooltip); 
         target.bind('mouseleave', function() { 
          jQuery(this).css({ 
           "background-position": "top" 
          }); 
         }); 
        }); 
       } 
      } 
      jQuery(window).on("resize", tooltipInit); 
      jQuery(document).on("ready", tooltipInit); 

このツールチップは、このウェブサイトhttp://visia.themes.tf/ にこの1に似ている私はあなたの助けに感謝しますしてください

答えて

1

こんにちはdevideがモバイルデバイスであるかどうあなたのコード

を実行して追跡するためのコードの下に使用してください
if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { 
// some code.. 
} 
+0

答えていただきありがとうございますが、上記のコードはナビゲータメニューに関連しており、少し質問から離れていて、前のものと同じ結果につながっています。問題は、デバイスのモバイルかどうか、私がモバイルからそれをクリックした後にツールチップを隠すことができないのではないかどうかをチェックすることではありません –

関連する問題