您好,欢迎访问一九零五行业门户网

html在鼠标按钮在元素上按下时触发的事件属性onmousedown

实例
当在段落上按下鼠标按钮时执行一段 javascript:
<p onmousedown="mousedown()">请点击此文本!</p>
浏览器支持
ie
firefox
chrome
safari
opera
所有主流浏览器都支持 onmousedown 属性。
定义和用法
onmousedown 属性在鼠标按钮在元素上按下时触发。
提示:相对于 onmousedown 事件的事件次序(限于鼠标左/中键):
onmousedown onmouseup onclick
相对于 onmousedown 事件的事件次序(限于鼠标右键):
onmousedown onmouseup oncontextmenu
注释:onmousedown 属性不适用以下元素:<base>、<bdo>、<br>、<head>、<html>、<iframe>、<meta>、<param>、<script>、<style> 或 <title>。
html 4.01 与 html5 之间的差异
无。
语法
<element onmousedown="script">
属性值
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的详细内容。
其它类似信息

推荐信息