-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwidget.html
118 lines (75 loc) · 1.89 KB
/
widget.html
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<!DOCTYPE html>
<html style="height: 100%; margin: 0px; padding: 0px; overflow: hidden;"><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<head>
</head>
<title>Widget</title>
<style>
#node{
border:1px solid red;
width:50px;
height:50px;
display:block;
}
#popup{
background-color:#ccc;
position:absolute;
border:3px solid #333;
width:200px;
-moz-box-shadow: 10px 10px 5px #888;
-webkit-box-shadow: 10px 10px 5px #888;
box-shadow: 10px 10px 5px #888;
margin:10px;
padding:10px;
}
}
#popup h2 {
font:Verdana, Arial, Helvetica, sans-serif;
font-size:12px;
}
#popup img{
}
#popup #closebox {
color: #333;
position: absolute;
right: 10px;
top: 10px;
text-decoration:none;
}
</style>
<script src="js/jquery.js" type="text/javascript"></script>
<script>
$(document).ready(function() {
//Following events are applied to the trigger (Hover events for the trigger)
$('#node').mouseenter(function() {
createPopup(this, "DEA Informant","photos/pain.jpg", "media/somevideo.mp4", 200, 250);
});
$('#node').mouseleave(function() {
//removePopup(this);
});
});
function createPopup(thisnode, title, imgsrc, videosrc, x, y){
var $newdiv1 = $('<div id="popup"/>');
var $title = $('<h2>' + title + '</h2>');
$newdiv1.append("<a href='" + videosrc + "'><img src='" + imgsrc + "'></a>").append($title);
$newdiv1.append("<a id='closebox' class='close' href='#'>X</a>");
$("section").append($newdiv1).animate({opacity:1},'slow');
$($newdiv1).css("top", x).css("left", y);
$('#closebox').click(function (e) {
e.preventDefault();
removePopup();
//load video popup?
});
}
function removePopup(){
$("#popup").animate({opacity:0},'slow');
$("#popup").remove();
}
</script>
<section>
<div id="node">
<div class="content"><p>I am a popup</p>
</div>
</section>
</html>