Created
May 2, 2010 01:42
-
-
Save erikeldridge/386818 to your computer and use it in GitHub Desktop.
A little yui 3 to launch popup
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 little yui 3 to launch popup | |
Usage: | |
1. mix this in w/ your html | |
2. click the "click" link | |
3. observe popup | |
License: Yahoo! BSD http://gist.github.com/375593 | |
--> | |
<a id="target">click</a> | |
<script src="http://yui.yahooapis.com/3.1.0/build/yui/yui-min.js"></script> | |
<script> | |
YUI().use('node', function(Y) { | |
var a = Y.one( 'a#target' ); | |
function handleClick ( e ) { | |
var popup = window.open( | |
a.get('href'), | |
'window name', | |
'toolbar=0,scrollbars=1,location=1,statusbar=1,menubar=0,resizable=1,width=500,height=500,left=200,top=200' | |
); | |
e.preventDefault(); | |
} | |
a.on( 'click', handleClick ); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks! This is just what I was looking for!