如何在lightbox2中打开JavaScript小部件照片?
当我点击照片时,它会在新选项卡中打开。如何在lightbox2中打开它 若你们给我一个示例代码,在blogger默认的lightbox中打开图片,那个么这是可以的 这是我的密码如何在lightbox2中打开JavaScript小部件照片?,javascript,html,widget,lightbox2,panoramio,Javascript,Html,Widget,Lightbox2,Panoramio,当我点击照片时,它会在新选项卡中打开。如何在lightbox2中打开它 若你们给我一个示例代码,在blogger默认的lightbox中打开图片,那个么这是可以的 这是我的密码 <script src="http://www.panoramio.com/wapi/wapi.js?v=1&hl=en" type="text/javascript"></script> <style type="text/css"> #div_attr_ex .pan
<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>
#分区属性,例如全景wapi图像{
背景色:透明;
}
var sand={'tag':'Saudi Arabia'};
var sandRequest=新的全景照片请求(sand);
变量属性列表选项={
“宽度”:880,
‘高度’:630,
“列”:4,
“行”:3,
“裁剪照片”:错误,
“disableDefaultEvents”:[panoramio.events.EventType.PHOTO_CLICKED],
“方向”:panoramio.PhotoListWidgetOptions.orientation.VERTICAL,
'AttributesStyle':panoramio.tos.Style.HIDDEN};
var attr_ex_list_widget=新的panoramio.PhotoListWidget(
“photo_widget_id_b”、sandRequest、attr_ex_list_选项);
var attr_ex_attr_options={'width':310};
var attr_ex_attr_widget=新的panoramio.TermsOfServiceWidget(
“photo_widget_id_c”,属性(属性选项);
函数最大化窗口(hWnd){
hWnd.moveTo(0,0);
hWnd.resizeTo(屏幕宽度、屏幕高度);
}
函数onListPhotoclick(事件){
var position=event.getPosition();
var photo=event.getPhoto();
若果(照片){
最大化窗口宽度(窗口打开)http://static.panoramio.com/photos/large/“+photo.getPhotoId()+”.jpg');
}
}
全景,事件,听(
attr_ex_list_小部件,panoramio.events.EventType.PHOTO_单击,
函数(e){onListPhotoClicked(e);});
attr_ex_list_widget.setPosition(0);
attr_ex_list_widget.enablePreviousArrow(false);
attr_ex_list_widget.enableNextArrow(false);
我已经看到了您的链接,要在light box中打开图像,您必须更改包装图像的锚定标记的href属性。在这里遵循jquery lightbox教程 或者您可以在此处选择以下任一选项
这是我的代码,它没有锚定标记onListPhotoClicked2(事件){var position=event.getPosition();var photo=event.getPhoto();if(photo){MaximizeWindow(window.open(');}}}函数MaximizeWindow(hWnd){hWnd.moveTo(0,0);hWnd.resizeTo(screen.width,screen.height);}panoramio.events.listen(attr_ex_photo_小部件,panoramio.events.EventType.photo_单击,函数(e){onListPhotoClicked2(e);});好的,所以您没有向图像添加任何锚定链接。这些链接是由谷歌自己添加的。解决方案可能会更改所有锚定标记并更改href属性,或者尝试此事件来触发您的lightbox功能。它可能会工作,但需要小部件代码(您从panoramio下载的代码)我的简单问题是如何通过函数调用打开一个灯箱?请遵循它的简单步骤。但为了进一步参考,您可能希望实施