鍍金池/ 問答/HTML5  Android  HTML/ 引入了一個(gè)可拖動(dòng)的插件 但是每次登陸 里面第一次點(diǎn)擊都無效 然后正常很煩

引入了一個(gè)可拖動(dòng)的插件 但是每次登陸 里面第一次點(diǎn)擊都無效 然后正常很煩

<div class="sortable-container" sv-root sv-on-sort="onSorted(AcctList);" sv-part="AcctList" sv-on-start="onStarted($part, $item, $index)" sv-on-stop="onStopped($part, $item, $index)">
                <div ng-repeat="item in dataList" sv-element="opts" class="well">
                    <a ng-click="Fc()">{{item.name}}</a>
                </div>
</div>

$scope.dataList = [
                {
                    'name':'john',
                    'age':'22'
                },
                {
                    'name':'vtime',
                    'age':'23'
                },
                {
                    'name':'eee',
                    'age':'44'
                }
            ];

            $scope.Fc =function(){
                console.log(2222);
            }

插件里有段代碼

function onMousedown(e){
                    touchFix(e);

                    if($controllers[1].sortingInProgress()) return;
                    if(e.button != 0 && e.type === 'mousedown') return;
}

是不是mousedown函數(shù)把我第一次的點(diǎn)擊吃了 angularjs項(xiàng)目 效果都有 就是遍歷的內(nèi)容a標(biāo)簽有點(diǎn)擊事件 每次登陸進(jìn)來點(diǎn)擊第一次都無效 第二下開始一切正常
插件地址:https://github.com/kamilkp/an...

回答
編輯回答
心癌

a標(biāo)簽沒有href,angular里會(huì)event.preventDefault(), 換一個(gè)標(biāo)簽試試

——-
上面回答的不對(duì),不是這個(gè)引起的

2018年1月8日 17:03
編輯回答
熊出沒

解決了 內(nèi)容中的事件標(biāo)簽是a和img 在mousedown函數(shù)里判斷事件源的標(biāo)簽名 return就行了

2018年4月18日 03:22