Skip to content

Instantly share code, notes, and snippets.

@erikeldridge
Created May 2, 2010 01:42
Show Gist options
  • Save erikeldridge/386818 to your computer and use it in GitHub Desktop.
Save erikeldridge/386818 to your computer and use it in GitHub Desktop.
A little yui 3 to launch popup
<!-- 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>
@jhempy
Copy link

jhempy commented Feb 12, 2015

Thanks! This is just what I was looking for!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment