Results 1 to 9 of 9
Thread: JavaScript ( )
Hybrid View
-
7th December 2008 16:51 #1Mire-x
Join Date: Apr:2005
Location: Sofia
Posts: 763
JavaScript ( )
, :
, . :Code:var SimpleContextMenu = { ... setup : function() { ...; document.oncontextmenu = SimpleContextMenu._show; document.onclick = SimpleContextMenu._hide; ... } _show : function() { this.hide(); ... } _hide : function() { ... } ... } SimpleContextMenu.setup;
(document.oncontextmenu), ( ): "this._hide() is not a function". _hide() setup() - !Code:function SimpleContextMenu() { ... this.setup = function () { ...; document.oncontextmenu = this._show; document.onclick = this._hide; ... } this._show = function() { this._hide(); ... } this._hide = function() { ... } ... } var cm = new SimpleContextMenu(); cm.setup;
? , , .
.
(10b) || !(10b)
-
7th December 2008 16:57 #2
_hide _show.
EVGA X299 FTW K|i9-7960X@4.7|4x8 Patriot Viper Steel 4000|GTX 1660 Ti|970 EVO 1 TB|Seasonic Focus GX-1000|Xigmatek Elysium|
Rampage IV Extreme BE|E5-1680v2@4.7|4x4 HyperX 1866|Cougar Aqua 240|GTX 1050 Ti|970 EVO 1/4 TB|CM 850 SilentPro|HAF-X|
-
7th December 2008 17:34 #3Mire-x
Join Date: Apr:2005
Location: Sofia
Posts: 763
-
7th December 2008 18:34 #4Registered User
Join Date: Aug:2006
Location: Sofia
Posts: 37
:
Code:... var self = this; this._show = function() { self._hide(); ... } this._hide = function() { ... } ...
-
7th December 2008 19:13 #5Mire-x
Join Date: Apr:2005
Location: Sofia
Posts: 763
-
7th December 2008 20:19 #6
, , this _hide _show , document. , ,

.. !
this
, document.Code:for(i in this) alert(i+":"+i[this]);
, , .
EVGA X299 FTW K|i9-7960X@4.7|4x8 Patriot Viper Steel 4000|GTX 1660 Ti|970 EVO 1 TB|Seasonic Focus GX-1000|Xigmatek Elysium|
Rampage IV Extreme BE|E5-1680v2@4.7|4x4 HyperX 1866|Cougar Aqua 240|GTX 1050 Ti|970 EVO 1/4 TB|CM 850 SilentPro|HAF-X|
-
7th December 2008 21:38 #7Mire-x
Join Date: Apr:2005
Location: Sofia
Posts: 763
-
11th December 2008 16:56 #8Registered User
Join Date: Jul:2005
Location: Sofiq
Posts: 2,798
oThis = this :
. IE? .Code:function SimpleContextMenu() { var oThis = this; this._show = function() { oThis._hide(); ... } // this this._hide = function() { ... } }
Code:document.oncontextmenu = function (e) { if (!e) e = window.event; if(e.preventDefault) e.preventDefault(); e.cancelBubble = true;//IE :) oThis._show(); };Last edited by _ShadoW_; 11th December 2008 at 17:09.
-
11th December 2008 17:37 #9Mire-x
Join Date: Apr:2005
Location: Sofia
Posts: 763
- , .
(10b) || !(10b)




Reply With Quote

Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in