I would like to be able to add an attribution reference to the Slide show images using jquery.
Whiole this should be elementary I am a total clutz at Jquery especially when applying it to an existing system which has its own Jquery code.
I have found a system of jquery which will anotate an image:
http://expansive-derivation.ossreleasefeed.com
(I have the code the site seems to not be accessable at this time.)
(function($){
$.fn.attribute = function(options) {
var defaults = {
message: "Image Courtesy "
};
var options = $.extend(defaults, options);
$("img[rel]").each(function() {
var relVal = $(this).attr("rel");
var relValueArray = jQuery.makeArray(relVal.split("|"));
if(relValueArray[0] === "attribute") {
$(this).parent().css("position", "relative");
var author = relValueArray[1];
var source = relValueArray[2];
var imageWidth = $(this).attr("width");
$(this).parent().prepend("<div class='attribution' style='width:" + imageWidth + "px;'>" + options.message + author +
" : <a href='" + source + "'>View Original Context</a></div>");
$(".attribution").fadeTo("fast", 0.7);
}
});
};
})(jQuery);
The image needs to look like this:
<p><img src="images/oldtruck.jpg" width="500" height="333" rel="attribute|aussiegall|http://image/4670590096/" /></p>
I am assuming that you can add the rel-attribute|author|link" into the slideshow image designation and them chain the effects some way.
Am I thinking correctly? Any advice will be appreciated.
Bill