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
This article mainly introduces touch. js drag, zoom, rotate (mouse gesture) function, the code is easy to understand, very good, has reference value, friends who need can refer to the following to achieve gesture operations: drag, zoom, and rotate. The encapsulated script method is as follows:
Var cat = window. cat | {}; cat. touchjs = {left: 0, top: 0, scaleVal: 1, // scale rotateVal: 0, // rotate curStatus: 0, // record the status of the current gesture, 0: drag, 1: Zoom, 2: Rotate // initial
is created:
Mqueue = new keyq (); the thread in the parent class is called.
In this thread, the local method readevent is called;
Thread mthread = new thread ("inputdevicereader "){
Public void run (){
.......................
Rawinputevent EV = new rawinputevent ();
While (true ){
Try {
Inputdevice di;
// This is a local method
Readevent (EV );
.......................
}
}
Because we track the JN
. util. log; import android. view. motionevent; import android. view. view; import android. widget. listview; public class scrolllistviewdelete extends listview {private float mindis = 10; private float mlastmotionx; // remember the position of private float mlastmotiony on the last x touch screen; // remember the position of the last y touch screen. Private Boolean islock = false; Public scrolllistviewdelete (context, attributeset attrs) {super (context, attrs);}/*** if the onintercepttoucheven
The div layer moving with the mouse uses ieff. You can pay attention to compatibility issues. . Center_p2
{
Position: absolute;
Z-index: 1;
Text-align: center;
Display: none;
Background-color: # e0e7ef;
}
. Center_p_tips2
{
Position: relative;
Color: Red;
}
Updating data...
The Code is as follows:
Function IsIE (){Var OsObject = "";If (navigator. userAgent. indexOf ("MSIE")> 0 ){Return true;}}Function mouseMove (ev ){/* The event mechanism of i
content in richtextbox1 to the fileM_streamwriter.write (richtextbox1.text );// Close this fileM_streamwriter.flush ();M_streamwriter.close ();
How to Implement print preview:
Print preview is implemented through the print preview dialog box. To print and preview a text file after reading, the most important thing is to notify the print preview dialog box of the content of the file to be previewed. The following code displays the content displayed in richtextbox1 in the print preview dialog
How does js disable the Backspace key to bring the browser back? jsbackspace
In the project, if you press the Backspace key to bring the browser back, several solutions are not ideal. Therefore, the wisdom of the masses and the wisdom of the family are summarized as follows:
1. Define the method to block Backspace in public js
Function banBackSpace (e) {var ev = e | window. event; // obtain the event object var obj =
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
action triggers a series of touch events: ACTION_DOWN->ACTION_MOVE->...->ACTION_MOVE->ACTION_UPFor this event distribution mechanism in Android, this event refers to Motionevent. The distribution of the view's events is also a distribution operation to Motionevent. You can use GETRAWX and Getrawy to get the horizontal ordinate of events relative to the upper-left corner of the screen. Gets the horizontal ordinate of the event relative to the upper-left corner of the current view through Getx ()
Yesterday to do something to touch the event conflict, before also often encounter event conflict, think to study the Android event conflict mechanism, so from yesterday to today to a full day to understand this knowledge, this only understand the Android touch and click event mechanism. Explore the following:First rewrite the three view layouts for testing: Packagecom.example.yzj.android_8_10;ImportAndroid.content.Context;ImportAndroid.util.AttributeSet;ImportAndroid.util.Log;Importandroid.
, 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
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.