class_bbcode edit :
Code:
return '<img src="' . $link . '" border="0" alt="" class="imageresize" onload="resize_image(this, \'' . $link . '\', 540);" />';
vbulletin_global.js edit
Code:
* @param string Image object
* @param string Image link
* @param integer Image max width
*/
function resize_image(obj, link, maxwidth)
{
if (obj.width > maxwidth)
{
obj.style.cursor = 'pointer';
obj.style.width = maxwidth + 'px';
obj.style.height = parseInt(obj.height * maxwidth / obj.width) + 'px';
obj.onclick = function()
{
window.location.href = link;
return false;
};
}
}
and the css
HTML Code:
.imageresize {
text-decoration: none;
padding : 4px;
border : 4px solid #eeeeee;
max-width: 540px; width: expression(this.width > 540 ? 540: true);
}