【发布时间】:2014-04-22 20:11:41
【问题描述】:
我正在开发一个带有图库页面 (www.eastcoastglassnc.com/projects.hmtl) 的网站。我遇到的问题是模态窗口应该出现,但它卡在加载轮上。我知道这个问题可能是我忽略的,所以我想我会得到一双新的眼睛。这是我正在使用的代码。
缩略图 HTML:
<div class="box col5"><a href="style/images/projects/bbt/bbt1.jpg" data-gal="prettyPhoto" title=""><span class="overlay zoom"></span><img src="style/images/projects/bbt/thumb1.png" alt=""/></a></div>
JavaScript
$(document).ready(function(){
$("a[data-gal^='prettyPhoto']").prettyPhoto({autoplay_slideshow: false, overlay_gallery: false, social_tools:false, deeplinking: false, theme:'pp_default', slideshow:5000, hook: 'data-gal'});
});
jQuery
// Find out if the picture is part of a set
theRel = $(this).attr('data-gal');
galleryRegExp = /\[(?:.*)\]/;
isSet = (galleryRegExp.exec(theRel)) ? true : false;
// Put the SRCs, TITLEs, ALTs into an array.
pp_images = (isSet) ? jQuery.map(matchedObjects, function(n, i){ if($(n).attr('data-gal').indexOf(theRel) != -1) return $(n).attr('href'); }) : $.makeArray($(this).attr('href'));
pp_titles = (isSet) ? jQuery.map(matchedObjects, function(n, i){ if($(n).attr('data-gal').indexOf(theRel) != -1) return ($(n).find('img').attr('alt')) ? $(n).find('img').attr('alt') : ""; }) : $.makeArray($(this).find('img').attr('alt'));
pp_descriptions = (isSet) ? jQuery.map(matchedObjects, function(n, i){ if($(n).attr('data-gal').indexOf(theRel) != -1) return ($(n).attr('title')) ? $(n).attr('title') : ""; }) : $.makeArray($(this).attr('title'));
您的任何输入都会很棒!
【问题讨论】:
标签: javascript jquery html prettyphoto