I'm using the jquery bpopup plugin. I'd like to use the same script for all buttons/popups on a page. Unfortunately each button click only works once after page load. I would be very thankful for you help!
<!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>
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
<script src="http://dinbror.dk/downloads/jquery.bpopup-0.7.0.min.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
$('.button').live('click', function(e) {
// Prevents the default action to be triggered.
e.preventDefault();
// Triggering bPopup when click event is fired
$(this).find('.popup').bPopup({
});
});
});
</script>
</head>
<body>
<!-- Button 1 -->
<div class="button">Button1
<div class="popup" style="background-color:#fff; width:400px; height:400px; display:none">
PopUp Content1
</div>
</div>
<!-- Button 2 -->
<div class="button">Button2
<div class="popup" style="background-color:#fff; width:400px; height:400px; display:none">
PopUp Content2
</div>
</div>
</body>
</html>