Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/76.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中显示以前隐藏的图像_Javascript_Html_Css_Ajax_Prototype - Fatal编程技术网

无法在javascript中显示以前隐藏的图像

无法在javascript中显示以前隐藏的图像,javascript,html,css,ajax,prototype,Javascript,Html,Css,Ajax,Prototype,HTML中带有id=“mobile\u right\u folder\u Image”的图像预计在启动时隐藏。事件发生时,图像应可见 使用内联display:none隐藏图像,并尝试使用图像id在Javascript函数中显示图像。在应用程序中使用prototype-AJAX 我试过javascript中的display、visibility属性,但似乎没有任何帮助。我在不同的位置有一个相似的图像,效果很好 我怀疑父对象的某些属性不允许显示图像子对象。请帮忙 HTML Code structur

HTML中带有
id=“mobile\u right\u folder\u Image”
的图像预计在启动时隐藏。事件发生时,图像应可见

使用内联
display:none
隐藏图像,并尝试使用图像id在Javascript函数中显示图像。在应用程序中使用prototype-AJAX

我试过javascript中的display、visibility属性,但似乎没有任何帮助。我在不同的位置有一个相似的图像,效果很好

我怀疑父对象的某些属性不允许显示图像子对象。请帮忙

HTML Code structure below :


<div id="mc_div_main">
<div id="mc_div_folders_container" style="width: 144px; display: none;">
    <div id="mc_div_content" style="left: 0px;" name="mc_div_content">
        <div id="mc_div_report" class="content" style="display: none" name="content_div"> </div>
        <div id="mc_div_compose" class="content" style="display: none" name="content_div"> </div>
        <div id="mc_div_message_list" class="content" name="content_div">
            <div id="rs_container" class="tile_container" style="overflow: hidden">
                <div class="tile_title_bar">
                        <img id="mobile_right_folder_image" border="0" onclick="javascript:f_folderVSMsgDisplay('1');" style="vertical-align: middle; height: 16px; padding-left: 2px; display:none" src="images/col_chooser_right.gif">
                    <span class="shadow">
                    <span class="tile_header_widgets" style="text-align: right; margin-right: 8px;">
                </div>
            <div id="rs_document" style="height: 150px;">
            <p> </p>
        <div id="rs_separator" class="separator" style="top: 172px;"> </div>
        <div id="rs_calendar" style="bottom: 0px; overflow: auto; top: 178px;">     
        </div>
        </div>
        </div>
        </div>
    </div>



Java script :

         document.getElementById('mobile_right_folder_image').style.display='';

使用Prototype时,请使用
$('mobile\u right\u folders\u image')。show()

mc\u div\u folders\u container
是隐藏的,因此其所有子体(图像是子体)无论其样式如何都不可见

document.getElementById('mc_div_folders_container').style.display='inline-block';
document.getElementById('mobile_right_folder_image').style.display='block';

javascript函数完成后检查html,查看图像是否具有display:none样式。我认为父元素的样式会影响将显示设置为真正的css值,例如“无”或“内联”或“块”不确定,但如果有内联样式,则可能存在重叠冲突。尝试使用!在JS中很重要,或者将内联样式移动到CSS文件。更好的html树结构如下:@Musa,感谢您的快速响应。刚刚用更好的HTML树更新了主要问题。我尝试了prototype.show(),它对显示图像没有帮助。还尝试使用新图像更新(),但不起作用。
document.getElementById('mc_div_folders_container').style.display='inline-block';
document.getElementById('mobile_right_folder_image').style.display='block';