2016-04-07 34 views
0

CRM (drupal) ve mobil için araç ipucunu kullanarak web sitesinde çalışıyorum, onu tekrar tıkladığımda nasıl gizleyeceğimi bilmiyorum. Bu, servis sayfasındaki http://www.cfb.it web sitesinin masaüstü bilgisayar için iyi çalışması ama telefondan web sitesine erişmeye çalıştığımda (iphone ve samsung denedim) ve üzerine tıkladığımda, araç ipucu görünür ancak kaldığım tıklandığında tekrar gizleyemem.Araç ipucu nasıl gizlenir?

İşte bu ipucu için jQuery kodu, eksik olanı bilmiyorum.

(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); 

Bu ipucu http://visia.themes.tf/ Ben bölmek mobil cihaz ya da değil o zaman yürütme kodunuzu ise izlemek için Alo

cevap

1

yardımına Lütfen lütfen takdir kodunun altına kullanacağı Bu web sitesinde buna benzer

if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { 
// some code.. 
} 
+0

Cevabınız için teşekkürler, ancak yukarıdaki kod navigasyon menüsü ile ilgilidir ve sorudan biraz uzaktır, aynı zamanda bir öncekiyle aynı sonuca yol açar. Sorun, cep telefonuna tıkladıktan sonra araç ipucunu gizleyemediğimi sorun değil mi? –