有没有办法使用 jQuery 来定位 Popcorn.js 元素。示例:我在下面将其作为文本区域中带有 div 的方法。如果该人不想等待 8 秒直到元素关闭,我将添加一个关闭跨度以尝试关闭父 div。这是在我的 script.js
example.popupFootnote({ "id": "footnote",
"start": 2,
"end": 10,
"target": "footnotes",
"title": "Tear Gas",
"text": '<div id="exampleBox"><span style="float:right; margin-right:10px">Close Window</span><a href="http://en.wikipedia.org/wiki/Tear_gas">Tear gas</a>, formally known as a lachrymatory agent or lachrymator (from lacrima meaning "a tear" in Latin), is a non-lethal chemical compound that stimulates the corneal nerves in the eyes to cause tearing, pain, and even blindness. Common lachrymators include OC, CS, CR, CN, nonivamide, bromoacetone, phenacyl bromide, xylyl bromide and syn-propanethial-S-oxide (from onions). Lacrymators often share the structural element Z=C-C-X, where Z indicates carbon or oxygen, and X indicates bromide or chloride.</div>',
top: '10%',
left: '70%'
});`
因此,当单击元素“closeWindow”然后其父框关闭时,我不想这样做。
这是在脚本标签之间的 HTML 中我的 script.js 下面的 index.html 中。
$(document).ready(function () {
$('#closeWindow').click(function () {
$(this).parent().parent().hide();
});
});
HTML 元素的布局如下:
<div id="movieHolder">
<div id="video" style="width: 750px; height: 422px;" ></div>
<div id="overlayDiv"></div>
<div id="overlayDiv-Map"></div>
<div id="footnotes"></div>
</div>