[divan] plutôt comme ça pour que ça fonctionne

This commit is contained in:
Esenjin 2021-10-21 21:53:36 +02:00
parent 1f22391336
commit 4cc5a76738

View File

@ -139,26 +139,6 @@
<!-- 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];
}
});
$(".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"
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
@ -200,6 +180,28 @@
});
});
</script>
<!-- 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];
}
});
$(".gotime").click(function (e) {
e.preventDefault();
$("audio").prop("currentTime", $(this).data("time"))
})
})
</script>
</body>
</html>