首页 新闻 会员 周边 捐助

swfupload按钮不显示?

0
悬赏园豆:20 [已关闭问题] 关闭于 2012-05-13 21:32

swfupload在ie下不显示按钮,ie6,7,8,9,火狐都不行,配置的文件都是照着别人配置的,flash player 为 11  用的插件为v2,不知道哪不对,谁知道能说下吗?

代码配置如下:

View Code
 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>
冷水寒冰的主页 冷水寒冰 | 初学一级 | 园豆:0
提问于:2012-05-10 14:08
< >
分享
所有回答(3)
0

flash看着头晕,不能试试别的么?

icepy | 园豆:587 (小虾三级) | 2012-05-10 16:14

我就是想知道这个为啥不行。

支持(0) 反对(0) 冷水寒冰 | 园豆:0 (初学一级) | 2012-05-11 07:55
0

同样的问题,求大神回答呀

codeWord | 园豆:202 (菜鸟二级) | 2014-07-28 14:30
0

遇到相同的问题,文字显示出来了,背景图片和边框一直不出来。

情在故园 | 园豆:234 (菜鸟二级) | 2014-12-26 14:15

问题解决了:

button_image_url属性 该背景图片必须是一个sprite图片,从上到下包含了Flash按钮的正常、鼠标悬停、按下、禁用这四种状态。因此该图片的高度应该是Flash按钮高度的四倍
我设置的图片高度怎么会有四倍。

支持(0) 反对(0) 情在故园 | 园豆:234 (菜鸟二级) | 2014-12-26 15:24
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册