我正在加载所有附加到 wordpress 帖子的拇指图像。
http://www.piagrimbuehler.ch/wordpress/skill/food/
当我单击 Thumb 时,项目页面打开,图像显示在 flexslider 中。但我希望 flexslider 显示我点击的拇指。
我正在尝试使其与 HashTags 一起使用。我已经使用图像 ID 创建了 URL。
http://www.piagrimbuehler.ch/wordpress/projects/waldhaus-kuche/#125 像这样。
但现在 flexslider 应该显示正确的图像。谁能指导我正确的方向?
这是我的 flexslider 脚本:
jQuery('.flexslider').flexslider({
slideshowSpeed: 6000,
directionNav: true,
slideshow: 1,
controlsContainer: '.slideshow',
animation: 'fade',
touch: true,
controlNav: false
});
我发现了这个脚本:
(jQuery.noConflict())(function($) {
//Get your hash tag
var loc = $(location).attr('href');
var idx = 1;
if(loc.lastIndexOf('#') != -1)
{
idx = loc.substr(loc.lastIndexOf('#')+1).replace('slide', '');
}
//verify that idx is really a number
if(isNaN(idx-0))
{
idx = 1;
}
$('#yourFlexSlider').flexslider ({
startAt: idx
});
});
但我无法让它工作。