天天看點

php onmouse,html在滑鼠按鈕在元素上按下時觸發的事件屬性onmousedown

執行個體

當在段落上按下滑鼠按鈕時執行一段 JavaScript:

請點選此文本!

浏覽器支援

IE

Firefox

Chrome

Safari

Opera

所有主流浏覽器都支援 onmousedown 屬性。

定義和用法

onmousedown 屬性在滑鼠按鈕在元素上按下時觸發。

提示:相對于 onmousedown 事件的事件次序(限于滑鼠左/中鍵):

相對于 onmousedown 事件的事件次序(限于滑鼠右鍵):

onmousedown onmouseup oncontextmenu

注釋:onmousedown 屬性不适用以下元素:、、

、、、、、、

HTML 4.01 與 HTML5 之間的差異

無。

文法

屬性值

script onmousedown 發生時運作的腳本。document.onmousedown = function() {

$scope.isShowDisQuit = false;

$scope.isShowJoinGroup = false;

};//點選任意出關閉表情框

$(document).off('click').on('click', function(e) {

if($(e.target).closest('.clickHeadTo').length || $(e.target).closest('.content-right-empty').length){

return;

}

if(!$(e.target).closest('.not-hide-floater').length){

$('.em-floater').hide();

}

$scope.isShowGroupMember = false;

$scope.isShowMember = true;

$scope.isHideMember = false;

if($scope.deptCount > 1){

$scope.countVisible = true;

}

$scope.visible = false;

$scope.$apply();

$('[recentUserId=' + localStorage.getItem('recentUserId') + ']').addClass('on');

});//點選任意出關閉右鍵彈窗

$(document).off('click').on('click', function(e) {

$scope.iscontextMenus = false;

if (!$scope.$$phase) {

$scope.$apply();

}

})//群會話消息滾動事件觸發關閉右鍵彈層

groupTarget.onscroll = function (){

isContextMenusHide();

}

//滑鼠擡起時關閉右鍵彈層

document.onmouseup = function() {

isContextMenusHide();

};

function isContextMenusHide (){

$scope.iscontextMenus = false;

if (!$scope.$$phase) {

$scope.$apply();

}

}

以上就是html在滑鼠按鈕在元素上按下時觸發的事件屬性onmousedown的詳細内容,更多請關注php中文網其它相關文章!

php onmouse,html在滑鼠按鈕在元素上按下時觸發的事件屬性onmousedown

本文原創釋出php中文網,轉載請注明出處,感謝您的尊重!