这是导致变量“src”未定义的完整代码——不知道为什么。
<div class="photoslider" id="default"></div>
<script type="text/javascript">
$(document).ready(function(){
//change the 'baseURL' to reflect the host and or path to your images
FOTO.Slider.baseURL = '';
//set images by filling our bucket directly
FOTO.Slider.bucket = {
'default': {
<% if imgs1 <> "" then %> 0: {'thumb': '<%=replace(imgs1,"pn.","tn.")%>', 'main': '<%=imgs1%>'}<% end if %><% if imgs2 <> "" then %>,
1: {'thumb': '<%=replace(imgs2,"pn.","tn.")%>', 'main': '<%=imgs2%>'}<% end if %><% if imgs3 <> "" then %>,
2: {'thumb': '<%=replace(imgs3,"pn.","tn.")%>', 'main': '<%=imgs3%>'}<% end if %><% if imgs4 <> "" then %>,
3: {'thumb': '<%=replace(imgs4,"pn.","tn.")%>', 'main': '<%=imgs4%>'}<% end if %><% if imgs5 <> "" then %>,
4: {'thumb': '<%=replace(imgs5,"pn.","tn.")%>', 'main': '<%=imgs5%>'}<% end if %>
}
};
FOTO.Slider.reload('default');
FOTO.Slider.preloadImages('default');
FOTO.Slider.enableSlideshow('default');
//or set our images by the bucket importer
//var ids = new Array(0,1,2,3);
//FOTO.Slider.importBucketFromIds('default',ids);
console.log($('.photoslider_main img'));
var src = $(".photoslider_main img").attr("src");
$(".photoslider_main img").wrap($('<a/>').attr('href', 'waka').attr('class','lightbox'));
$('a.lightbox').lightBox();
// $('.photoslider_main img').live('click', function() {
// $(this).showLightbox();
// });
});
</script>