答案 0 :(得分:0)
summary::-webkit-details-marker {
display: none;
}
答案 1 :(得分:0)
根据您的要求,我可以建议以下内容:
$('details').click(function(e){ e.preventDefault(); });
您必须阻止默认行为。就像你想阻止提交表格的按钮......
请注意,在这种情况下,细节将被隐藏,因此您必须更改为:
<details open>details</details>
答案 2 :(得分:0)
仅供参考,更完整的答案 - 必须在CSS和Javascript上进行调整:
<强>使用Javascript:强>
var d=document.querySelectorAll('details:not(open)'),
i=d.length,
f=function(e){e.preventDefault();};
while(i-- > 0) {
// set the open attribute to the elements that doesn't have one
d[i].setAttribute('open','');
// disable open/close behavior
d[i].onclick = f;
}
// cleanup
delete(d);
delete(i);
delete(f);
或jQuery样式:
$('details:not(open)').attr('open',true).click(function(e){ e.preventDefault(); });
<强> CSS:强>
/* disable <summary> marker/arrow on webkit */
summary::-webkit-details-marker { display: none;}
/* disable outline when clicked */
summary:focus{outline:none;}