exiting the device. The initial reason is that the custom ViewGroup customviewabve intercepts the gesture event, so that the subview cannot respond if it fails to accept the event.
Then we can go to the source code of the SlidingMenu control and find customviewabve. java, and then we find this method onInterceptTouchEvent (). This method is a method of ViewGroup to trigger onTouchEvent () to this ViewGroup and its various childView () previously, related events were intercepted. if onInterceptT
tips: you can modify some code and then press run]
Get mouse movement information
First, we need to get the coordinates of the mouse. we can add a User Function to document. onmousemove:
Document. onmousemove = mousemove;
Function mousemove (EV ){Ev = EV | window. event;VaR mousepos = mousecoords (EV );}
execute]
Get mouse movement information
First, we need to get the coordinates of the mouse. we can add a User Function to document. onmousemove:
Copy codeThe Code is as follows: document. onmousemove = mouseMove;
Function mouseMove (ev ){Ev = ev | window. event;Var mousePos = mouseCoords (ev );}
Function mouseCoord
Because IE is the event is the global and Firefox event is local, not very convenient to use, this time we have to assemble their own common event operation, encapsulation into class for easy reuse
Copy Code code as follows:
/**
Class Event
Usage:
Event.getevent (); Get Ie,firefox Event
Event.gettarget () to get IE's srcelement or Firefox target
Event.isie (); IE
Event.clientx (); Get Ie,fox's Mouse x coordinates
Event.clienty (); Gets the mouse y-coordinate of the Ie,fox
*/
trigger, not afraid, we have a trick:The event object provides a property called Target, which can return the destination node of the event, we become the source of the event, that is, the target can be represented as the DOM of the current event operation, but not actually manipulating the DOM, of course, this is compatible, Standard browser with Ev.target,ie browser with Event.srcelement, at this time just get the position of the current node, do not know what node name, here we use nodename
, of course, this is compatible, Standard browser with Ev.target,ie browser with Event.srcelement, at this time just get the position of the current node, do not know what node name, here we use nodename to get exactly what tag name, this return is a uppercase, we need to turn to lowercase to do comparison (habit problem):Window.onload = function () {var Oul = document.getElementById ("Ul1");Oul.onclick = function (EV) {var
boolean ontouchevent (Motionevent event)-for incident consumption, three classes have this methodpublic boolean onintercepttouchevent (motionevent ev)-for intercepting events, only ViewGroup has this methodThe three methods are the same for use in three classes, but the detailed processing process is different. This we will explain in the next section.two. The dispatchtouchevent process of motionevent1.Activity PartFor normal understanding, it should
public boolean dispatchtouchevent (motionevent ev)
View/viewgroup handles the initiator of an event distribution, View/viewgroup receives a touch event that first is tuned, and then determines whether to handle the interception or distribute the event to the child container in the method
public boolean onintercepttouchevent (motionevent ev)
ViewGroup dedicated, this method can reach the direction of di
During the development process, JavaScript may be used to implement drag-and-drop functions. This article will introduce this issue in depth. For more information, see
Js drag
Simple closure implementation
The Code is as follows:
/*** Created with JetBrains WebStorm.* User: lsj* Date: 12-11-24* Time: PM* To change this template use File | Settings | File Templates.*/Var dragmanager = (function (){// Identify the Z axis coordinate of the moving ElementVar index_z = 1;// The current drag Elem
This article introduces the support for ExtJS4.1 shortcut keys. If you need a friend, refer to the following question. One page has two panels and each has a [add (F2)] button. How do you support shortcut keys? Image Diagram
First implementationIt should be very simple. ExtJs provides "Ext. util. KeyMap", which is easy to support shortcut keys.Sample Code
The Code is as follows:
///
Ext. onReady (function (){Var viewport = Ext. create ('ext. container. viewport ',{Layout :{Type: 'vbox ',Align
--------------------------------------------------------------------------------------------------------------------- -------------Split Line */Drag-and-drop packagefunction drag (obj) {Obj.onmousedown = function (EV) {var ev = EV | | Eventvar disx = Ev.clientx-this.offsetleft;var disy = ev.clienty-this.offsettop;if (obj.setcapture) {//This time obj listens for s
Question one page has two panels with a [add (F2)] button. How do I support the shortcut key? Image Diagram
First implementationIt should be very simple. ExtJs provides "Ext. util. KeyMap", which is easy to support shortcut keys.Sample CodeCopy codeThe Code is as follows:/// Ext. onReady (function (){Var viewport = Ext. create ('ext. container. viewport ',{Layout :{Type: 'vbox ',Align: 'stretch'},Padding: 10,Items :[{Xtype: 'panel ',Id: 'panela ',Title: 'test keypa ',Tbar :[{Text: 'add (F2 )'}]
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.