I completely changed how this works. In the original version JavaScript detected an onload event and that would fire a function that would use DOM to set the image width to match the specified span width.
HTML Code:
<span style="width:{option}px" name="resize">
{param}
</span>
<script type="text/javascript">
<!--
function resize(event) {
var image = is_ie ? event.srcElement : event.target ;
if(image.tagName=='IMG'){
if(image.parentNode.getAttribute('name')=='resize'){
if(image.style.width!=image.parentNode.style.width){
image.style.width = image.parentNode.style.width
}}}
}
if (document.addEventListener) {
document.addEventListener("load", resize, true);
}
else if (document.attachEvent) {
document.attachEvent("onload", resize);
}
//-->
</script>
Now the image width is simply inherited from the span. Much simpler!
If you have already created this BB code replace the HTML with the present code., everything else is the same