jquery - Use the rel text in the current text displayed by Colorbox -
is possible use rel text in current text displayed colorbox?
i have gallery of images grouped rel="project name"
<a href="gallery/in01 _gsm1 450x582.jpg" rel="project name" title="global supplier management brochure cover" name="intertek"> <div><span class="projectname">intertek</span></div> <img src="thumbs/galleryintertek.jpg" /> </a>
i current text "project name 1 of 10" instead of "image 1 of 10". possible use value rel= in current= text
edit: have multiple galleries rel need dynamic. http://ggsc.info/new/index.html
here colorbox jquery:
$("div.projectblock").each(function(index){ var classname = "group" + (index+1); $(this).find("a") .addclass(classname) .colorbox({maxwidth:'95%', maxheight:'95%', current: '{current} of {total}'}); });
in current parameter, hoping "current: '{rel} {current} of {total}'"
you can manually change var
in plugin:
line 62: current: "image {current} of {total}",
change image project name.
edit:
$("div.projectblock").each(function (index) { var classname = "group" + (index + 1), $this = $(this), rel = $this.find("a").attr("rel"); $(this).find("a") .addclass(classname) .colorbox({ maxwidth: '95%', maxheight: '95%', current: rel + '{current} of {total}' }); });
Comments
Post a Comment