【发布时间】:2014-03-17 09:31:11
【问题描述】:
我有一个砖石画廊,目前,如果您单击任何缩略图,它会链接到不同页面中的幻灯片,无论您单击哪个缩略图,幻灯片都会显示第一个图像。我想知道是否有办法让幻灯片以缩略图点击的图像开始。
我尝试了这篇文章,但似乎没有这样做。
Linking to specific headers on other pages
我是怎么做到的,
缩略图:
<a href="#the_slide">
<div class="m_overlay"><div class="m_txt"><?php echo $image['title']; echo $image['caption'];?>"</div></div>
<img src="<?php echo $image['url'];?>" title="<?php echo $image['title']; echo $image['caption'];?>" alt="<?php echo $image['alt']; ?>">
</a>
幻灯片中的图片
<?php
global $post;
$parent_id = $post->post_parent;
$parentlink = get_permalink($parent_id);
$images = get_field('gallery', $parent_id);
?>
<ul class="slideshow">
<?php foreach( $images as $image ): ?>
<li>
<h2 class="slideshow_title"><?php echo $image['title'];?></h2>
<table>
<tr>
<td>
<div class="slideshow_image"><a name="the_slide"></a><img src="<?php echo $image['url'];?>" alt="<?php echo $image['alt']; ?>"></div>
</td>
</tr>
</table>
</li>
<?php endforeach; ?>
</ul>
感谢您的帮助!
【问题讨论】:
-
幻灯片是您制作的吗?或者它是一个插件?如果有,是什么插件?
-
我正在使用 jQuery Cycle
-
向我们展示代码...
<a name="the_slide">没有任何意义。 -
jQuery Cycle 本身并不支持这一点。您可以使用 $_GET 变量更改将图像回显到页面中的顺序。
-
@David:你能详细说明一下吗?我对PHP真的不熟悉。
标签: javascript jquery html css image