gaidalou

区分移动端和pc端:

window.navigator.userAgent.toLowerCase().indexOf(\'mobile\')== -1   判断  等于-1就是pc,false就是移动端。

 

 

mouseenter和mouseleave 防止了嵌套的触发;

if(window.navigator.userAgent.toLowerCase().indexOf(\'mobile\')==-1){
		$(\'.dropdown\').bind(\'mouseenter\',function(){
			$(this).parent().siblings().find(\'.dropdown\').removeClass(\' open\');
			$(this).addClass(\' open\');
		}).bind(\'mouseleave\',function(){
			$(this).removeClass(\' open\');
		})

  

分类:

技术点:

相关文章:

  • 2021-11-26
  • 2021-11-26
  • 2021-07-03
  • 2021-11-26
  • 2022-12-23
  • 2021-11-26
  • 2022-02-13
猜你喜欢
  • 2022-02-05
  • 2021-11-26
  • 2021-11-26
  • 2021-10-09
  • 2021-05-10
  • 2021-11-26
  • 2021-12-07
相关资源
相似解决方案