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>