Javascript LightBox和传单创建图像库
我目前正在尝试实现一个地图,上面满是生成的标记。在标记的每个弹出框中都有一个图像,单击时的每个图像都将以Lightbox模式显示。有没有人知道,在我的图片打开一个模式,但没有链接到其他图片的那一刻,是否有可能将所有这些放在一起 为了调试,我在同一个页面中添加了一些图片,这些图片不在地图上,看起来效果不错Javascript LightBox和传单创建图像库,javascript,jquery,google-maps,lightbox,leaflet,Javascript,Jquery,Google Maps,Lightbox,Leaflet,我目前正在尝试实现一个地图,上面满是生成的标记。在标记的每个弹出框中都有一个图像,单击时的每个图像都将以Lightbox模式显示。有没有人知道,在我的图片打开一个模式,但没有链接到其他图片的那一刻,是否有可能将所有这些放在一起 为了调试,我在同一个页面中添加了一些图片,这些图片不在地图上,看起来效果不错 关于如何使jquery和地图出现问题的任何帮助 我使用jquery UI的对话框创建了类似于灯箱的东西 请参阅此线程: JSFiddle: //Creates the div element
关于如何使jquery和地图出现问题的任何帮助 我使用jquery UI的对话框创建了类似于灯箱的东西 请参阅此线程: JSFiddle:
//Creates the div element in jQuery
var container = $('<div/>');
// Creates a variable holding html string to go in above container
// Note I made the same image thats going to be enlarged into a smaller 120x90 thumbnail
var tempimg = '<div id="dialog" style="display: none;"><img id="image" src=""/></div><div class="myImage"><img src="http://www.w3schools.com/images/pulpit.jpg" alt="myimage" width="120" height="90"/></div> Click to enlarge';
// Upon clicking the .myImage Class in the container (which is the thumbnail) Open a jQueryUI Dialog...
container.on('click', '.myImage', function() { $('#dialog').dialog(
//...which upon when it's opened...
{open: function(){
///... assign a variable that can acess the div id 'image'...
imageTag = $('#image');
///... and set the image src in #image (note that it'll be the fullsize this time)...
imageTag.attr("src","http://www.w3schools.com/images/pulpit.jpg");
},closeOnEscape: true, modal:true});
});
container.html(tempimg);