2014-01-08 32 views

回答

0

我想通过javascript。在手机上,点击打开菜单,然后点击重定向你。 :)

var state; 
$(".dropdown > a").click(function (event) { 
    var isMenu = $(this).parent().find('ul').text(); 

    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { 
     if (isMenu == "") { 
      href = $(this).attr('href'); 
      window.location = href; 
     } else { 
      if (!state) { 
       state = true; 
       return false; 
      } else { 
       state = false; 
       href = $(this).attr('href'); 
       window.location = href; 
      } 
     } 

    } else { 
     var href = $(this).attr('href'); 
     window.location = href; 
    } 
});