⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 event.js

📁 这是一个关于java的JSP页面中使用象Swing组件的一个库文件.
💻 JS
字号:
function uiHtml_Event(event) {  this._super();  if (event == null) {      this.__domEvent = window.event;    this.__w3cModel = false;  }  else {      this.__domEvent = event;    this.__w3cModel = true;  }}uiHtml_Event = uiUtil_Object.declareClass(uiHtml_Event, uiUtil_Object);uiHtml_Event.prototype.getDomSource = function() {  if (this.__w3cModel) {    return this.__domEvent.currentTarget;  }  else {    return this.__domEvent.srcElement;  }};uiHtml_Event.prototype.preventBubble = function() {  if (this.__w3cModel) {    this.__domEvent.stopPropagation();  }  else {    this.__domEvent.cancelBubble = true;  }};uiHtml_Event.prototype.preventDefault = function() {  if (this.__w3cModel) {    this.__domEvent.preventDefault();  }  else {    this.__domEvent.returnValue = false;  }};uiHtml_Event.prototype.getViewPortPosition = function() {  return new uiUtil_Dimension(this.__domEvent.clientX, this.__domEvent.clientY);};uiHtml_Event.prototype.getAbsolutePosition = function() {  return new uiUtil_Dimension(      uiHtml_Document.getInstance().getScrollLeft() + this.__domEvent.clientX,      uiHtml_Document.getInstance().getScrollTop() + this.__domEvent.clientY);};uiHtml_Event.prototype.isAltPressed = function() {  return this.__domEvent.altKey;};uiHtml_Event.prototype.isCtrlPressed = function() {  return this.__domEvent.ctrlKey;};uiHtml_Event.prototype.isShiftPressed = function() {  return this.__domEvent.shiftKey;};uiHtml_Event.prototype.getPressedChar = function(optToLower) {  var code = this.__domEvent.keyCode;  if (this.__w3cModel) {    code = this.__domEvent.which;  }  var character = String.fromCharCode(code);  if (uiUtil_Type.getBoolean(optToLower, false)) {    character = character.toLowerCase();  }  return character;};uiHtml_Event.__getDomObject = function(event) {  if (event == null) {      return window.event;  }  else {      return event;  }};uiHtml_Event.getViewPortPosition = function(event) {  var domEvent = uiHtml_Event.__getDomObject(event);  return new uiUtil_Dimension(domEvent.clientX, domEvent.clientY);};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -