It looks like you're new here. If you want to get involved, click one of these buttons!
jQuery(document).ready(function($) {
if( $(".Message").length > 0 ) {
var fpImage = $(".Message"); // message containing images
var maxWidth = 150; // maximum width of an image inserted into message
var rel = "prettyPhoto"; // you could use lightBox as well ... :)
var className = ""; // whatever you want it to be...
var count = 0;
fpImage.each(function() {
fpImage.find("img").each(function() {
// prepare the link title
var title = ( $(this).attr("title")!="" ) ? $(this).attr("title") : $(".DiscussionTabs .SubTab").text();
if( $(this).width() > maxWidth ) // if the width is bigger than maximum allowed
$(this)
.css( "width", maxWidth+"px" ) // apply new maximum width
.wrap('<a href="'+$(this).attr('src')+'" title="'+title+'" rel="'+rel+'[gallGroup'+count+']" class="'+className+'" />'); // wrap with ancho
});
count++;
});
}
});
Comments
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •