[divan] balises temps du sommaire cliquables
This commit is contained in:
parent
76a78d8e06
commit
1f22391336
@ -1,5 +1,5 @@
|
||||
<!doctype html>
|
||||
<html class="no-js" lang="zxx">
|
||||
<html class="no-js" lang="fr">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
@ -26,6 +26,7 @@
|
||||
<link rel="stylesheet" href="css/slick.css">
|
||||
<link rel="stylesheet" href="css/slicknav.css">
|
||||
<link rel="stylesheet" href="css/style.css">
|
||||
|
||||
<!-- <link rel="stylesheet" href="css/responsive.css"> -->
|
||||
</head>
|
||||
|
||||
@ -138,9 +139,25 @@
|
||||
|
||||
<!-- music_area end -->
|
||||
|
||||
<!-- timecode -->
|
||||
|
||||
<script type="text/javascript">
|
||||
$("document").ready(function () {
|
||||
$("p").each(function (k, v) {
|
||||
let texte = v.textContent;
|
||||
let match = texte.match(/(.*)\[(.*)\](.*)/);
|
||||
if (Array.isArray(match)) {
|
||||
let times = match[2].split(":");
|
||||
let time = (Number(times[0]) * 3600) + (Number(times[1]) * 60) + Number(times[2])
|
||||
v.innerHTML = match[1] + "<a href='#!' class='gotime' data-time='" + time + "'>[" + match[2] + "]</a>" + match[3];
|
||||
}
|
||||
});
|
||||
|
||||
<!-- link that opens popup -->
|
||||
$(".gotime").click(function (e) {
|
||||
e.preventDefault();
|
||||
$("audio").prop("currentTime", $(this).data("time"))
|
||||
})
|
||||
}</script>
|
||||
|
||||
<!-- JS here -->
|
||||
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
|
||||
|
Loading…
Reference in New Issue
Block a user