2

I am using the JQuery tools located at http://flowplayer.org/tools/index.html

I currently have this code below triggering the overlay

<div id="triggers">
<img src="http://farm4.static.flickr.com/3651/3445879840_7ca4b491e9_m.jpg" rel="#mies1"/>

as you can see we are using the rel attribute to call the overlay with an image. I would like to call the overlay with plain text or a link.

At the very bottom of the page their is a script tag including this

$(document).ready(function() { $("img[rel]").overlay(); });

I can provide any other information that may be needed. Thank you!

4

3 回答 3

0

html

<a href="#" id="makeOverlay">Overlay</a>

js

$("#makeOverlay").on('click', function(e) {
     e.preventDefault();
     $("img[rel]").overlay();
});
于 2012-03-04T23:20:32.153 回答
0

不确定您是否仍然需要答案,但只需要找出类似的东西,然后想出了

<a rel="#mies1"> Your text </a>

<div class="simple_overlay" id = "mies1"> Your overlay content</div>

在你的 javascript 部分

$("a[rel]").overlay();

这对我有用。

于 2012-07-26T08:41:35.387 回答
0

可以通过以下用于图像的相同方法在链接上调用它:

<div id="triggers">
<a href="#" id="makeOverlay" rel="#mies1">Trigger Overlay</a>
</div>

jQuery:

$(document).ready(function() { $("#triggers a[rel]").overlay(); });

'rel' 属性指向我们想要作为覆盖打开的 div 的 id

于 2012-03-05T01:42:42.027 回答