我有一个用作图片库的 URL。在这个 URL 上是一个大拇指div
(为简洁起见,我只显示四个大拇指):
<div id="thumbs">
<img src="graphics/thumbs/01.jpg" width="190" height="190" class="thumb objects" id="project01" />
<img src="graphics/thumbs/08.jpg" width="190" height="190" class="thumb web" id="project08" />
<img src="graphics/thumbs/14.jpg" width="190" height="190" class="thumb freehand" id="project14"/>
<img src="graphics/thumbs/04.jpg" width="190" height="190" class="thumb freehand objects" id="project04" /></div>
和一个空div
叫#content
:
<div id="content"></div>
和一个隐藏的div
叫#preload
:
<div id="preload">
<span id="project01_content"><img src="graphics/010.jpg" /></span>
<span id="project02_content"><img src="graphics/022.jpg" /><img src="graphics/021.jpg" /><img src="graphics/023.jpg" /><img src="graphics/020.jpg" /></span>
<span id="project03_content"><img src="graphics/030.jpg" width="450" height="600" /><img src="graphics/031.jpg" width="450" height="600" /></span>
<span id="project04_content"><img src="graphics/040.jpg" width="775" height="600" /><img src="graphics/041.jpg" width="775" height="600" /></span></div>
我的 jQuery 使用单击缩略图的 ID 到clone()
相应图像中的图像,并使用该方法span
将它们放入。它工作得很好。现在,我想返回并已经填写了 Project 01。#content
html()
mysite.com/#project01
#content
如何给每个图像一个哈希 URL 来调用相同的 jQuery 状态?