hankknight
asked on
Help with Facebook-Style MooTools Modal Box
I want to open Google's website inside this modal box:
http://davidwalsh.name/dw-content/facebook-modal.php
My code does not work.
http://davidwalsh.name/dw-content/facebook-modal.php
My code does not work.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Demo</title>
<script src="http://davidwalsh.name/dw-content/mootools-1.2.1.js" type="text/javascript"></script>
<script type="text/javascript">
window.addEvent('domready',function() {
/* hide using opacity on page load */
$('fb-modal').setStyles({
opacity:0,
display:'block'
});
/* hiders */
$('fb-close').addEvent('click',function(e) { $('fb-modal').fade('out'); });
window.addEvent('keypress',function(e) { if(e.key == 'esc') { $('fb-modal').fade('out'); } });
$(document.body).addEvent('click',function(e) {
if($('fb-modal').get('opacity') == 1 && !e.target.getParent('.generic_dialog')) {
$('fb-modal').fade('out');
}
});
/* click to show */
$('fb-trigger').addEvent('click',function() {
$('fb-modal').fade('in');
});
});
</script>
<link rel="stylesheet" type="text/css" media="all" href="smoothbox.css" />
</head>
<body>
<h1> Hello World </h1>
<a id="fb-trigger" href="http://www.google.com/">Example 2</a>
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
My mame copy/cut :
Open in new window