Right. You can make things more efficient and at the same time more easily configurable, like so:
Code:
/*Image Thumbnail Viewer II (May 19th, 2010)
* This notice must stay intact for usage
* Author: Dynamic Drive at http://www.dynamicdrive.com/
* Visit http://www.dynamicdrive.com/ for full source code
*/
//Last updated: Sept 26th, 2010: http://www.dynamicdrive.com/forums/showthread.php?t=57892
jQuery.noConflict()
jQuery.thumbnailviewer2={
loadmsg: '<img src="spinningred.gif" /><br />Loading Large Image...', //HTML for loading message. Make sure image paths are correct
textbox: ['<textarea class="largetag" cols="50" rows="2" wrap="off">', '</textarea>'], //Before and after HTML for textboxes
/////NO NEED TO EDIT BEYOND HERE////////////////
dsetting: {trigger:'mouseover', preload:'yes', fx:'fade', fxduration:500, enabletitle:'yes'}, //default settings
buildimage:function($, $anchor, setting){
var imghtml='<img src="'+$anchor.attr('href')+'" style="border-width:0" />',
link = setting.link? $('<a href="'+setting.link+'">').get(0).href : '';
if (link)
imghtml='<a href="'+link+'">'+imghtml+'</a>'
imghtml='<div>'+imghtml+(link? '<br />'+this.textbox[0]+'<img src="'+link+'" alt="">'+
this.textbox[1]+this.textbox[0]+'[img]'+link+'[/img]'+this.textbox[1] : "")+'</div>'
return $(imghtml)
},
Bookmarks