图片上传前预览(兼容FF和IE).docVIP

  • 1
  • 0
  • 约5.03千字
  • 约 6页
  • 2016-12-30 发布于重庆
  • 举报
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN /TR/xhtml1/DTD/xhtml1-transitional.dtd html xmlns=/1999/xhtml head meta http-equiv=Content-Type content=text/html; charset=utf-8 / titleFirefox3,IE6,IE7,IE8上传图片预览/title style type=text/css #preview_wrapper{ display:inline-block; width:300px; height:300px; background-color:#CCC; } #preview_fake{ /* 该对象用户在IE下显示预览图片 */ filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale); } #preview_size_fake{ /* 该对象只用来在IE下获得图片的原始尺寸,无其它用途 */ filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=image); visibility:hidden; } #preview{ /* 该对象用户在FF下显示预览图片 */ width:300px; height:300px; } /style style type=text/css #preview_wrapper{ display:inline-block; width:300px; height:300px; background-color:#CCC; } #preview_fake{ /* 该对象用户在IE下显示预览图片 */ filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale); } #preview_size_fake{ /* 该对象只用来在IE下获得图片的原始尺寸,无其它用途 */ filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=image); visibility:hidden; } #preview{ /* 该对象用户在FF下显示预览图片 */ width:300px; height:300px; } /style script type=text/javascript function onUploadImgChange(sender){ if( !sender.value.match( /.jpg|.gif|.png|.bmp/i ) ){ alert(图片格式无效!); return false; } var objPreview = document.getElementById( preview ); var objPreviewFake = document.getElementById( preview_fake ); var objPreviewSizeFake = document.getElementById( preview_size_fake ); if( sender.files sen

文档评论(0)

1亿VIP精品文档

相关文档