Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/404.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 防止在hide和show-jQuery上推送元素_Javascript_Jquery_Html_Css_Fieldset - Fatal编程技术网

Javascript 防止在hide和show-jQuery上推送元素

Javascript 防止在hide和show-jQuery上推送元素,javascript,jquery,html,css,fieldset,Javascript,Jquery,Html,Css,Fieldset,我在单击图例时隐藏并显示字段集中的内容 范例 var-legends=document.getElementsByTagName(“图例”); 对于(变量i=0;i 0) { var myDiv=myDivs[0]; 如果(myDiv.style.display==“”) { myDiv.style.display=“无” } 其他的 { myDiv.style.display=“”; } } } } 在展示内容后如何防止猫叫?在我的示例中,示例内容在显示内容后被向下推。如何重叠div内容?如

我在单击图例时隐藏并显示字段集中的内容

范例

var-legends=document.getElementsByTagName(“图例”);
对于(变量i=0;i 0)
{
var myDiv=myDivs[0];
如果(myDiv.style.display==“”)
{
myDiv.style.display=“无”
}
其他的
{
myDiv.style.display=“”;
}
}
}
}

在展示内容后如何防止猫叫?在我的示例中,示例内容在显示内容后被向下推。如何重叠div内容?

如果您使用jquery,我建议在弹出窗口中显示它。在html中尝试此代码,并确保引用jquery mobile:

<a href="#popupBasic" id="tet" data-rel="popup"><legend>One Legend</legend></a>

<div data-role="popup" id="popupBasic">
    <fieldset>

    <div>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.e</div>

</fieldset>
</div>
<div><text>Sample Content</text></div>

Lorem Ipsum只是印刷和排版行业的虚拟文本。自16世纪以来,Lorem Ipsum一直是行业标准的虚拟文本,当时一位不知名的印刷商拿起一个打印工具,将其拼凑成一本打印样本书。它不仅存活了五个世纪,而且还跨越到电子排版,基本上保持不变。它在20世纪60年代随着包含Lorem Ipsum段落的Letraset表单的发布而流行,最近又随着包括Lorem Ipsum.e版本的Aldus PageMaker等桌面出版软件的发布而流行
样本含量
jsfiddle:

<a href="#popupBasic" id="tet" data-rel="popup"><legend>One Legend</legend></a>

<div data-role="popup" id="popupBasic">
    <fieldset>

    <div>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.e</div>

</fieldset>
</div>
<div><text>Sample Content</text></div>