-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHelioBox.html
145 lines (133 loc) · 6.19 KB
/
HelioBox.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta charset="utf-8" />
<title>HelioBox - FancyBox Ligero</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="HelioBox - FancyBox Liger" />
<link type="image/x-icon" rel="shortcut icon" href="images/favicon.png">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300' rel='stylesheet' type='text/css'>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<style type="text/css">
body {
margin: 0;
padding: 0;
}
/*Estilos HelioBox*/
#heliobox-background { position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; z-index: 9999999; background: #000; text-align: center; opacity: .5; display: none; }
#heliobox-wrapper { position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; z-index: 99999999; text-align: center; /* overflow: hidden;*/ display: none; }
#heliobox-wrapper #heliobox-content { width: 600px; height: 625px; *margin: 0px auto; *display: inline-block;position: relative; background: transparent url(heliobox-loading.gif) no-repeat center center; }
#heliobox-wrapper #heliobox-content #heliobox-close { width: 30px; height: 30px; position: absolute; right: -15px; top: -15px; z-index: 2; background: transparent url(heliobox-cerrar.png) no-repeat center center; }
#heliobox-wrapper #heliobox-content #heliobox-iframe { width: 100%; height: 100%; position: absolute; left: 0px; top: 0px; z-index: 1; }
#heliobox-wrapper #heliobox-content #heliobox-iframe iframe { margin: 0px; padding: 0px; border: 0px; width: 100%; height: 100%; background: none; overflow: hidden; }
/*Fin*/
h1 {
margin: 0;
padding: 0;
}
#HelioBox1, #HelioBox2, #HelioBox3, #HelioBox4 {
margin: 30px 0
}
#HelioBox1, #HelioBox2, #HelioBox3, #HelioBox4, h1 {
display: block;
font-size: 40px;
text-align: center;
text-decoration: none;
color: #666
}
</style>
<script type="text/javascript">
jQuery.fn.heliobox = function(values) {
var val = jQuery.extend({}, jQuery.fn.heliobox.defaults, values);
return this.each(function() {
if(jQuery("#heliobox-background").length==0 ) {
jQuery("body").append('<div id="heliobox-background"></div><div id="heliobox-wrapper"><div id="heliobox-content"><a href="javascript:void(0);" id="heliobox-close"></a><div id="heliobox-iframe"></div></div></div>');
}
jQuery(this).click(function(e) {
e.preventDefault();
var bodyh = jQuery(document).height();
var windowh = jQuery(window).height();
var bodyw = jQuery(window.document).width();
var windowW = jQuery(window).width();
jQuery("#heliobox-background").css({
'height': bodyh > windowh ? bodyh : windowh,
'width': bodyw > windowW ? bodyw : windowW,
'display': 'block',
'background': val.background,
'opacity': (val.opacity / 100),
'filter': 'alpha(opacity=' + val.opacity + ')'
});
jQuery("#heliobox-wrapper").css({
'display': 'block'
});
jQuery('#heliobox-content').css({
'width': val.width + 'px',
'height': val.height + 'px'
});
jQuery("#heliobox-iframe").css({
'width': val.width + 'px',
'height': val.height + 'px'
}).html("").append('<iframe src="' + jQuery(this).attr('href') + '"></iframe>');
repositionOverlay();
$(window).on("resize", repositionOverlay);
$(window).on("scroll", repositionOverlay);
jQuery("#heliobox-background,#heliobox-close,#heliobox-wrapper").on('click', function() {
jQuery("#heliobox-background,#heliobox-wrapper,body").removeAttr('style');
jQuery("#heliobox-iframe").html("");
$(window).off("resize", repositionOverlay);
$(window).off("scroll", repositionOverlay);
});
return (false);
});
});
function repositionOverlay() {
var wh = jQuery(window).height();
var oh = jQuery("#heliobox-content").height();
var sh = jQuery(window).scrollTop();
var w = jQuery(window).width();
var cw = jQuery("#heliobox-content").width();
var sw = jQuery(window).scrollLeft();
jQuery("#heliobox-content").finish();
jQuery("#heliobox-content").animate({
"margin-top": wh > oh ? (((wh - oh) / 2) + sh) + "px" : "0px",
"margin-left": w > cw ? (((w - cw) / 2)) + sw + "px" : "0px"
}, 300);
}
};
jQuery.fn.heliobox.defaults = {
background: "#000",
opacity: 50,
width: 620,
height: 700,
type: "iframe"
};
jQuery(document).ready(function() {
jQuery("#HelioBox1").heliobox({
width: 610,
height: 656
});
jQuery("#HelioBox2").heliobox({
width: 610,
height: 656,
background: "#F00"
});
jQuery("#HelioBox3").heliobox({
width: 610,
height: 656,
opacity: 80
});
jQuery("#HelioBox4").heliobox();
});
</script>
</head>
<body>
<div id="wrapper">
<h1>Helio Box</h1>
<a id="HelioBox1" href="http://www.omnicancun.com.mx/_lib/recursos/msi/msi.html">Overlay Con Ancho y Alto Personalizados</a>
<a id="HelioBox2" href="http://www.omnicancun.com.mx/_lib/recursos/msi/msi.html">Overlay Con Background</a>
<a id="HelioBox3" href="http://www.omnicancun.com.mx/_lib/recursos/msi/msi.html">Overlay Con Opacidad</a>
<a id="HelioBox4" href="http://www.omnicancun.com.mx/_lib/recursos/msi/msi.html">Overlay Default</a>
</div>
</body>
</html>