-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path00_Eventos.js
More file actions
70 lines (53 loc) · 1.43 KB
/
Copy path00_Eventos.js
File metadata and controls
70 lines (53 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
'use strict'
$(document).ready(()=>{
//Eventos mouse over y mouse out
let caja = $("#caja");
let box = $("#box");
let box1 = $("#box1");
caja.mouseover(function(){
$(this).css("background","red");
});
caja.mouseout(function(){
$(this).css('background','green');
});
//Evento HOVER
function Violet(){
$(this).css('background','rebeccapurple');
}
function Dark (){
$(this).css('background','gray');
}
box.hover(Violet , Dark);
//Eventos Click & Double Click
box1.click(function(){
$(this).css('background','green');
});
//doble click
box1.dblclick(function(){
$(this).css('background','pink');
});
let name =$("#nombre");
name.focus(function(){
$(this).css('border','2px solid green');
});
name.blur(function(){
$(this).css('border','2px solid transparent');
$("#datos").text($(this).val()).show();
});
//Eventos mousedown & mouseup
let data = $("#datos1");
data.mousedown(function(){
$(this).css('border-color','red');
});
data.mouseup(function(){
$(this).css('border-color','blue');
});
//Mousemove
$(document).mousemove(function(){
console.log(event.clientX);
console.log(event.clientY);
$('body').css("cursor","none");
$("#sigueme").css("left", event.clientX)
.css("top", event.clientY);
});
});