Skip to content

Instantly share code, notes, and snippets.

@elijahmanor
Created January 30, 2012 04:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elijahmanor/1702566 to your computer and use it in GitHub Desktop.
Save elijahmanor/1702566 to your computer and use it in GitHub Desktop.
Find the jQuery Bug #3: Problem
<div id="dialog-modal">Hello World</div>
<!DOCTYPE html>
<html>
<head>
<link class="jsbin" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
<meta charset=utf-8 />
<title>JS Bin</title>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<style>
article, aside, figure, footer, header, hgroup,
menu, nav, section { display: block; }
</style>
</head>
<body>
<div id="dialog-modal">Hello World</div>
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js"></script>
<script src="https://getfirebug.com/firebug-lite.js"></script>
</body>
</html>
var popover = (function( $ ) {
var pub = {}, modal;
pub.init = function() {
modal = $( "#dialog-modal" );
if ( modal && modal.not( ".ui-dialog-content" ) ) {
console.log( "selection exists, but isn't initialized" );
modal.dialog({
height: 140,
modal: true,
autoOpen: false
});
}
};
pub.open = function() {
modal.dialog( "open" );
};
return pub;
}( jQuery ));
$(function() {
popover.init();
popover.open();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment