-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjquery.iframeDialog.js
executable file
·41 lines (41 loc) · 1.47 KB
/
jquery.iframeDialog.js
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
/*
* jQuery UI iframeDialog Plugin v1.2
* https://github.com/miyabis/jquery.iframeDialog
*
* Copyright 2012, MiYABiS
* Distributed under the [MIT License][mit].
* http://www.opensource.org/licenses/mit-license.php
*/
(function ($) {
$.fn.iframeDialog = function (options) {
this.each(function () {
$(this).unbind('click').click(function (e) {
e.preventDefault();
var $div = $("<div/>");
var $iframe = $('<iframe class="iframeDialog" name="iframeDialog{rnd}" frameborder="0" width="100%" height="100%" marginwidth="0" hspace="0" vspace="0" scrolling="no" allowtransparency="true" />');
if (!options.title) {
options.title = $(this).attr('title');
}
if (!options.url) {
url = $(this).attr('href');
} else {
url = options.url;
}
if (!options.close) {
options.close = function () {
$(this).remove();
};
}
if (options.id) {
$div.attr("id", options.id);
}
if (options.scrolling) {
$iframe.attr("scrolling", options.scrolling);
}
$iframe.attr("src", url);
$div.append($iframe).dialog(options);
});
});
return this;
};
})(jQuery);