swfupload在ie下不显示按钮,ie6,7,8,9,火狐都不行,配置的文件都是照着别人配置的,flash player 为 11 用的插件为v2,不知道哪不对,谁知道能说下吗?
代码配置如下:
1 <script type="text/javascript"> 2 var swfu; 3 window.onload = function () { 4 swfu = new SWFUpload({ 5 // Backend Settings 6 upload_url: "/UploadImgService.ashx", 7 post_params: { 8 "action": "upload", 9 "ASPSESSID": "<%=Session.SessionID %>" 10 }, 11 12 // File Upload Settings 13 file_size_limit: "2 MB", 14 file_types: "*.jpg", 15 file_types_description: "JPG Images", 16 file_upload_limit: 0, // Zero means unlimited 17 18 // Event Handler Settings - these functions as defined in Handlers.js 19 // The handlers are not part of SWFUpload but are part of my website and control how 20 // my website reacts to the SWFUpload events. 21 swfupload_preload_handler: preLoad, 22 swfupload_load_failed_handler: loadFailed, 23 file_queue_error_handler: fileQueueError, 24 file_dialog_complete_handler: fileDialogComplete, 25 upload_progress_handler: uploadProgress, 26 upload_error_handler: uploadError, 27 upload_success_handler: function (file, serverData) { 28 var strs = serverData.split("|"); 29 if (strs[0] == "ok") { 30 $("#imgBox").css("backgroundImage", "url(" + strs[1] + "?id=" + new Date() + ")"); 31 $("#imgBox").css("width", strs[2] + "px").css("height", strs[3] + "px"); 32 } 33 else { 34 alert("上传失败:" + serverData); 35 } 36 }, 37 upload_complete_handler: uploadComplete, 38 39 // Button settings 40 button_image_url: "/JS/swfupload/images/XPButtonNoText_160x22.png", 41 //button_image_url: "/js/swfupload/swfuploadbutton.swf", 42 button_placeholder_id: "spanButtonPlaceholder", 43 button_width: 160, 44 button_height: 22, 45 button_action: SWFUpload.BUTTON_ACTION.SELECT_FILES, 46 button_text: '<span class="button">插入本地图片(最大2M)</span>', 47 button_text_style: '.button { font-family: Helvetica, Arial, sans-serif; font-size: 14pt; } .buttonSmall { font-size: 10pt; }', 48 button_text_top_padding: 1, 49 button_text_left_padding: 5, 50 51 // Flash Settings 52 flash_url: "/JS/swfupload/swfupload.swf", // Relative to this file 53 flash9_url: "/JS/swfupload/swfupload_FP9.swf", // Relative to this file 54 55 custom_settings: { 56 upload_target: "divFileProgressContainer" 57 }, 58 59 // Debug Settings 60 debug: false 61 }); 62 }; 63 </script> 64 <body> 65 <form id="form1" action="" method="post" enctype="multipart/form-data"> 66 <div id="swfu_container" style="margin: 0px 10px;"> 67 <div> 68 <span id="spanButtonPlaceholder"></span> 69 </div> 70 <div id="divFileProgressContainer" style="height: 75px;"></div> 71 <div id="thumbnails"></div> 72 </div> 73 <div id="imgBox" style="width:200px;height:200px;"> 74 <div id="cutArea" style="border:1px solid red;width:50px;height:50px;"></div> 75 </div> 76 </form> 77 </body>
flash看着头晕,不能试试别的么?
我就是想知道这个为啥不行。
同样的问题,求大神回答呀
遇到相同的问题,文字显示出来了,背景图片和边框一直不出来。
问题解决了:
button_image_url属性 该背景图片必须是一个sprite图片,从上到下包含了Flash按钮的正常、鼠标悬停、按下、禁用这四种状态。因此该图片的高度应该是Flash按钮高度的四倍
我设置的图片高度怎么会有四倍。