本问题第1个回答
var _text = document.getElementById('text');function formatPic(){var _imgs = _text.getElementsByTagName("IMG");var _tabs = _text.getElementsByTagName("TABLE");for (i=0;i<_imgs.length;i++){if (_imgs[i].scrollWidth > 699){_imgs[i].width = "699";_imgs[i].onclick= showPic;_imgs[i].style.cursor="pointer";_imgs[i].alt="点击放大图片,再次点击将会显示图片全图和原始大小";}}for (i=0;i<_tabs.length;i++){if (_tabs[i].width > 699){_tabs[i].style.width = "699";}}}function showPic(){window.open("http://www.qqgb.com/a.htm?"+this.src);}if (_text){window.onload = formatPic;}