Created
December 30, 2009 16:43
-
-
Save SamWM/266169 to your computer and use it in GitHub Desktop.
jQuery UI Dialog iframe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("a.dialog").click( | |
function(e) { | |
e.preventDefault(); | |
var title = this.title; | |
if (!title.length) title = $(this).text(); | |
// create a dialog box and set the iframe to the linked page | |
var dialog = $("<div><iframe /></div>") | |
.find("iframe").attr({ "frameBorder": 0, "width": "100%", "height": "100%", "scrolling": "auto", "src": this.href }).end() | |
.dialog( | |
{ | |
title: title, | |
modal: true, | |
height: 500, | |
width: 650, | |
close: dialogClose | |
} | |
).find(".ui-dialog-content").css("padding", 0).end(); | |
} | |
); | |
function dialogClose(event, ui) { } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment