jquery colorbox open single image
I have an image in a repeater, I only want to open the image which has been clicked on, I don't want the other images to be available to do paging.
This is my line in the repeater:
<a title="jhddj" rel="relImageStatusUpdate" href="<%= format_status_image_url(row["UserID"],row["USERSTATUS_ID"]) %>"
id="ahrefStatusImage">
<img alt=""
src="<%= format_status_thumbnailimage_url(row["UserID"],row["USERSTATUS_ID"]) %>"/></a>
And the jquery is this:
开发者_开发百科$(document).ready(function () {
$("a[rel='relImageStatusUpdate']").colorbox();
});
Instead of setting the rel
to relImageStatusUpdate
, change it to nofollow
. This is from the ColorBox Docs
rel: false
This can be used as an anchor rel alternative for ColorBox. This allows the user to group any combination of elements together for a gallery, or to override an existing rel so elements are not grouped together. Example: $('#example a').colorbox({rel:'group1'})Note: The value can also be set to 'nofollow' to disable grouping.
and of course initialize Colorbox as follows:
$("a[rel='nofollow']").colorbox();
精彩评论