当我单击照片时,我有一个panaramio JavaScript 小部件,它在新选项卡中打开。如何在 lightbox2 中打开它?
如果您给我示例代码以在博主默认灯箱中打开图像,那也没关系。
这是我的代码
<script src="http://www.panoramio.com/wapi/wapi.js?v=1&hl=en" type="text/javascript"></script>
<style type="text/css">
#div_attr_ex .panoramio-wapi-images {
background-color: transparent;
}
</style>
<div id="div_attr_ex" style="float: center; margin: 5px 10px;">
<div id="photo_widget_id_b">
</div>
<div id="photo_widget_id_c">
</div>
</div>
<script type="text/javascript">
var sand = {'tag':'Saudi Arabia'};
var sandRequest = new panoramio.PhotoRequest(sand);
var attr_ex_list_options = {
'width': 880,
'height': 630,
'columns': 4,
'rows': 3,
'croppedPhotos': false,
'disableDefaultEvents': [panoramio.events.EventType.PHOTO_CLICKED],
'orientation': panoramio.PhotoListWidgetOptions.Orientation.VERTICAL,
'attributionStyle': panoramio.tos.Style.HIDDEN};
var attr_ex_list_widget = new panoramio.PhotoListWidget(
'photo_widget_id_b', sandRequest, attr_ex_list_options);
var attr_ex_attr_options = {'width': 310};
var attr_ex_attr_widget = new panoramio.TermsOfServiceWidget(
'photo_widget_id_c', attr_ex_attr_options);
function MaximizeWindow(hWnd){
hWnd.moveTo(0,0);
hWnd.resizeTo(screen.width, screen.height);
}
function onListPhotoClicked(event) {
var position = event.getPosition();
var photo=event.getPhoto();
if(photo){
MaximizeWindow(window.open('http://static.panoramio.com/photos/large/'+photo.getPhotoId()+'.jpg'));
}
}
panoramio.events.listen(
attr_ex_list_widget, panoramio.events.EventType.PHOTO_CLICKED,
function(e) { onListPhotoClicked(e); });
attr_ex_list_widget.setPosition(0);
attr_ex_list_widget.enablePreviousArrow(false);
attr_ex_list_widget.enableNextArrow(false);
</script>