() { var Oul = document.getElementById ("UL"); var aLi = Oul.getelementsbytagname ("Li");/* The event source is used here: The event object, the source, regardless of the event, as long as the element you are manipulating is the source of the event. Ie:window.event.srcElement Standard: Event.targetnodename: Find the label name of the element */Oul.onmouseover =function (EV) { var ev =
() { var Oul = document.getElementById ("UL"); var aLi = Oul.getelementsbytagname ("Li");/* The event source is used here: The event object, the source, regardless of the event, as long as the element you are manipulating is the source of the event. Ie:window.event.srcElement Standard: Event.targetnodename: Find the label name of the element */Oul.onmouseover =function (EV) { var ev =
= function () {
oDiv1.style.display = ' block ';
Require ('./scale.js '). scale (ODIV1,ODIV2);
Require.async ('./scale.js ', function (ex) {
ex.scale (ODIV1,ODIV2);
})
}
);
B Colleague
B colleague wrote Drag.js:
define (function (require,exports,module) {
function drag (obj) {
var disx = 0;
var disy = 0;
Obj.onmousedown = function (ev) {
var ev
compile.gcc -I/usr/local/include -o timeserver timeserver.c -L/usr/local/lib -levent(If the libevent header and library are placed in/usr/includeAnd/usr/libCan omit these two numbers ).
The original program comes at the end of the article.
event_init()Represents the number of changes used to initialize libevent.
event_set(ev, s, EV_READ | EV_PERSIST, connection_accept, ev)SetsPut this file descriptionev(Th
Number. Prototype. nan0 = function () {return isnan (this )? 0: This ;}
Function getposition (e ){VaR left = 0;VaR Top = 0;While (E. offsetparent ){Left + = E. offsetleft;Top + = E. offsettop;E = E. offsetparent;}
Left + = E. offsetleft;Top + = E. offsettop;
Return {X: Left, Y: Top };
}
Function mousecoords (EV ){If (EV. pagex | eV. Pagey ){Return {X:
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
*/
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.