avalon icon indicating copy to clipboard operation
avalon copied to clipboard

avalon.mobile触屏问题

Open weeksun23 opened this issue 11 years ago • 6 comments

html

<a href='#' ms-on-tap='$backToMeiju'>
   <i class='icon-angle-left icon-2x'></i> 
  <span class='header-btntxt'>{{$lang.back}}</span>
</a>

css

a.ms-click-active{color: #217CAD}

a绑定了tap事件,但发现tap a的时候,颜色没有变化,F12一看,ms-click-active没有加在a上,而是加在i或者span上,除非你真的tap到了a。。。请问这问题应该怎么解决? 测试版本:avalon.mobile.js 1.42 built in 2015.5.3 chrome 41.0.2272.101 m 手机模拟器

weeksun23 avatar May 06 '15 02:05 weeksun23

在线等,比较急

weeksun23 avatar May 06 '15 07:05 weeksun23

a ,i,span全部设置为display:inline-block看看

RubyLouvre avatar May 06 '15 09:05 RubyLouvre

你先根据情况自己绑定相应的class,avalon的ms-click-active目前只绑定在target元素上

ShirlyFE avatar May 06 '15 09:05 ShirlyFE

不是应该绑定在已经绑定了事件函数的且离target最近的父辈元素(或自身)上么?

weeksun23 avatar May 06 '15 09:05 weeksun23

现在不是,所以你需要active的话先自己绑定吧

ShirlyFE avatar May 06 '15 09:05 ShirlyFE

好麻烦啊~还要自己绑定touchstart touchend

<a href='#' ms-on-tap='$backToMeiju' ms-on-touchstart='$start' ms-on-touchend='$end'>
   <i class='icon-angle-left icon-2x'></i> 
  <span class='header-btntxt'>{{$lang.back}}</span>
</a>
$start : function(){
  this.classList.add("ms-click-active");
},
$end : function(){
  this.classList.remove("ms-click-active");
}

weeksun23 avatar May 06 '15 09:05 weeksun23