Skip to content

Instantly share code, notes, and snippets.

@mathieuancelin
Created January 20, 2012 13:20
Show Gist options
  • Save mathieuancelin/1647357 to your computer and use it in GitHub Desktop.
Save mathieuancelin/1647357 to your computer and use it in GitHub Desktop.
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css"></link>
</head>
<body>
<a href="#" class="btn success" onclick="openPopup(
new Array(
{
url:'http://www.google.fr',
x:100,
y:200,
width:60,
height:120
}, {
url:'http://www.twitter.com',
x:300,
y:200,
width:60,
height:120
}
))">Pop up 1</a>
<a href="#" class="btn success" onclick="openPopup(
new Array(
{
url:'page1.html',
x:100,
y:400,
width:60,
height:120
}, {
url:'page2.html',
x:300,
y:400,
width:60,
height:120
}, {
url:'page3.html',
x:500,
y:400,
width:60,
height:120
}
))">Pop up 2</a>
<a href="#" class="btn success" onclick="openPopup(
new Array(
{
url:'http://www.amazon.com',
x:100,
y:600,
width:400,
height:120
}
))">Pop up 3</a>
<script type="text/javascript">
function openPopup(pageNames) {
for (nbr in pageNames) {
var obj = pageNames[nbr];
var varp ='"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,width=' + obj['width'] + 'px,height=' + obj['height'] + 'px,';
open(obj['url'], 'fenetre' + obj['url'], varp + "left=" + obj['x'] + ", top=" + obj['y']);
}
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment