Find file
Fetching contributors…
Cannot retrieve contributors at this time
118 lines (75 sloc) 1.89 KB
<!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>