javascript实现的图片预览功能

前端之家收集整理的这篇文章主要介绍了javascript实现的图片预览功能前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

本文实例讲述了javascript实现的图片预览功能分享给大家供大家参考,具体如下:

1.将下面的代码复制到内

/* Thumbnail image viewer- ?Dynamic Drive (www.dynamicdrive.com) For full source code,usage terms,and 100's more DHTML scripts,visit http://dynamicdrive.com */ function enlarge(which,e){ //Render image code for IE 4+ if (document.all){ if (showimage.style.visibility=="hidden"){ showimage.style.left=document.body.scrollLeft+event.clientX showimage.style.top=document.body.scrollTop+event.clientY showimage.innerHTML='502_0@') document.showimage.document.close() document.showimage.left=e.x document.showimage.top=e.y document.showimage.visibility="show" } else document.showimage.visibility="hide" return false } //if NOT IE 4+ or NS 4,simply display image in full browser window else return true }

猜你在找的JavaScript相关文章