Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/89.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 并非html按钮的所有部分都可以单击_Javascript_Jquery_Html - Fatal编程技术网

Javascript 并非html按钮的所有部分都可以单击

Javascript 并非html按钮的所有部分都可以单击,javascript,jquery,html,Javascript,Jquery,Html,并非按钮“点击发布”的所有部分都是可点击的。因此,当我点击该按钮的“Cli”部分时,我看不到指针表示不可点击,因此也没有触发相应的事件。下面是问题所在的div。请看最后一个span元素,我指的是按钮- <div id="photodivmain" style="padding:4px; "> <div style="padding-bottom:8px; font-size:11px;"> <div style="margin-

并非按钮“点击发布”的所有部分都是可点击的。因此,当我点击该按钮的“Cli”部分时,我看不到指针表示不可点击,因此也没有触发相应的事件。下面是问题所在的div。请看最后一个span元素,我指的是按钮-

<div id="photodivmain" style="padding:4px; "> 
         <div style="padding-bottom:8px; font-size:11px;">
         <div style="margin-bottom:6px;font-size:11px;">Write in the message box.Click "Click to post" to publish.</div> <b>Message:</b> <div style="border:1px solid gray;padding:4px;margin-top:2px;background-color:white"><textarea id="postphdesc" style="border:none;border:0px solid transparent; width:100%;" rows="3"></textarea></div>
         </div>
          <div id="swfupload-control" style="font-size:11px;">
          <div style="margin-bottom:2px;"><b>Select an image file on your computer (jpg, png, gif,bmp).Maximum size of 2 MB)</b></div><input type="button" id="buttonFileUp" /><p id="queuestatus" ></p><ul style="list-style:none; list-style-type:none; text-decoration:none" id="log"><li style="list-style-type:none; list-style:none;"></li></ul></div>                 
         <div style="position:relative;">
            <span class="postwall-button" style="cursor:hand;cursor:pointer; padding:3px 5px 3px 5px;border:1px solid buttonface; font-weight:bold;margin:5px 0 4px 2px !important;font-size:15px; display:block; width:100px; text-align:center;" onclick="StartToDoWork()">Click to post</span>
        </div>
    </div>

在消息框中写入。单击“单击发布”发布。信息:
选择计算机上的图像文件(jpg、png、gif、bmp)。最大大小为2 MB)

    • 点击发布
此外,我还使用swfupload来选择上面的swfupload控制div要上载的文件。下面显示了我如何启动swfupload以及文件何时选择上面添加的某些元素

 <ul>
名单


jQuery('#swfupload control')。swfupload({
按钮图片url:“modules/mod\u posttofb/images/XPButtonNoText\u 160x22.png”,
按钮宽度:160,
按钮高度:22,按钮文字:“选择文件”,
按钮\文本\顶部\填充:1,
按钮\文本\左\填充:44,
button_占位符:jQuery('#buttonFileUp')[0],
……此处未显示的其他主要参数
})
.bind('fileQueued',函数(事件,文件){
jQuery('#log li').remove();
var listitem='
  • '+ '文件:'+File.name+'('+Math.round(File.size/1024)+'KB)'+ ''+ “

    附件

    ”+ “
  • ”; jQuery('#log').append(listitem); }) ……此处未显示的其他功能

    通过网络研究,我还没有找到解决方案,但我知道给出的位置:相对attr到span有效。但如果它有任何缺点,因为应用程序必须在ie8中工作,firefox,chrome…xp和win7中的浏览器。最主要的是除了Firefox之外,其他浏览器上的一切都可以使用。

    您不需要相对于
    postwall按钮的位置。
    设置z-index:9999。也许某个SWF部门占用了更多的空间。擦除
    cursor:hand

    如果没有更多的代码和css,这将很难复制。建议您尝试使用jsfiddle.net进行复制,并将其发回。很可能是div、span或与按钮重叠的元素。请尝试将
    postwall按钮的
    z-index
    CSS属性设置为类似999的值并进行检查。我将很快进行测试。哪个是无错误位置:相对还是z-index?请注意,在我给出了按钮的父div相对位置(如代码中所示)之后,当我选择文件时添加的“取消”按钮出现问题。请参阅脚本代码。因此,我为“取消”按钮提供了什么z索引?“位置:相对”不是必需的“z-index”将解决您的问题:-)实际上,我刚刚将z-index设置为10,它对我有效。
    <script type="text/javascript">
    jQuery('#swfupload-control').swfupload({            
        button_image_url: "<?php echo JURI::root(); ?>modules/mod_posttofb/images/XPButtonNoText_160x22.png",   
        button_width: 160,
        button_height: 22, button_text: '<span>Choose File</span>',
        button_text_top_padding: 1,
        button_text_left_padding: 44,
        button_placeholder : jQuery('#buttonFileUp')[0],
        ......other main parameters not shown here
    })
        .bind('fileQueued', function(event, file){
            jQuery('#log li').remove();
            var listitem='<li id="'+file.id+'" >'+
                'File: <em>'+file.name+'</em> ('+Math.round(file.size/1024)+' KB) <span class="progressvalue" style="font-weight:bold;" ></span>'+
                '<div class="progressbar" ><div class="progress" style="" ></div></div>'+
                '<p class="status" style="margin-bottom:1px;font-weight:bold;">Attached</p><input type="button" class="cancel" value="Cancel" id="cancelbutton" style="padding:2px; cursor:pointer;cursor:hand; font-weight: normal;background-color:#F2F2EE; border:1px solid black; -webkit-border-radius: 0.4em; -moz-border-radius: 0.4em;border-radius: 0.4em;"  />'+
                '</li>';
    
            jQuery('#log').append(listitem);                
        })
    ............other functions not shown here 
    </script>