2009-11-19 87 views
3

我使用夢幻般的PrettyPhoto燈箱,一個Jquery燈箱克隆。PrettyPhoto Jquery燈箱鏈接問題

要啓動一個燈箱和一個iframe這是代碼

<a href="http://www.google.com?iframe=true&width=100%&height=100%" rel="prettyPhoto[iframes]" title="Google.com opened at 100%">Google.com</a> 

這個偉大的工程!

的問題是,我使用JavaScript來讓我的一些div的鏈接與此代碼

<div onclick="http://www.google.com?iframe=true&width=100%&height=100%" rel="prettyPhoto[iframes]" class="menuitem"> 

可惜,這是行不通的。我懷疑這是因爲DIV不支持rel屬性。有沒有人有任何想法如何超過這個?

感謝您的幫助,

+0

--- <* crickets *> --- – a432511 2009-11-19 05:13:33

回答

4

退房插件js文件的第87行(jquery.prettyPhoto.js)

$('a[rel*='+theGallery+']').each(function(i){ 

它是專門尋找 '一' 元素。您可以查看插件並更改一些內容以使其適合您的需求。

$('div[rel*='+theGallery+']').each(function(i){ 

我應該補充說我不認爲rel是一個有效的div屬性。你可能想要使用一個類或其他可選屬性。

+0

非常感謝...太接近了,幾乎完美無缺。 – Tim 2009-11-20 05:13:19

+0

很高興能幫到你! – a432511 2009-11-20 14:33:15