script.js
1.48 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
/* ======================================================
# Web357 Framework - Joomla! System Plugin v1.5.1
# -------------------------------------------------------
# For Joomla! 3.x
# Author: Yiannis Christodoulou (yiannis@web357.eu)
# Copyright (©) 2009-2018 Web357. All rights reserved.
# License: GNU/GPLv3, http://www.gnu.org/licenses/gpl-3.0.html
# Website: https://www.web357.eu/
# Support: support@web357.eu
# Last modified: 09 Feb 2018, 13:55:18
========================================================= */
// Powered by: http://www.jqueryscript.net/lightbox/Super-Simple-Modal-Popups-with-jQuery-CSS3-Transitions.html
var jModal = jQuery.noConflict();
jModal(function(){
var appendthis = ("<div class='modal-overlay js-modal-close'></div>");
jModal('a[data-modal-id]').click(function(e) {
e.preventDefault();
jModal("body").append(appendthis);
jModal(".modal-overlay").fadeTo(500, 0.7);
//jModal(".js-modalbox").fadeIn(500);
var modalBox = jModal(this).attr('data-modal-id');
jModal('#'+modalBox).fadeIn(jModal(this).data());
});
jModal(".js-modal-close, .modal-overlay").click(function() {
jModal(".modal-box, .modal-overlay").fadeOut(500, function() {
jModal(".modal-overlay").remove();
});
});
jModal(window).resize(function() {
jModal(".modal-box").css({
top: (jModal(window).height() - jModal(".modal-box").outerHeight()) / 2,
left: (jModal(window).width() - jModal(".modal-box").outerWidth()) / 2
});
});
jModal(window).resize();
});