[英]Would like to add a pseudo-pause button in my slide controls
I'd like to add a pause button ~for my embedded media~ between my slide controls on the bottom-right of the page. 我想在页面右下方的幻灯片控件之间添加一个“暂停按钮”(用于我的嵌入式媒体)。
Because my slides go to the next upon completion of my embedded media, to pause the slideshow I'm using this element: 由于我的幻灯片在完成嵌入式媒体后会转到下一个,因此要暂停幻灯片放映,我使用了以下元素:
<button onclick="document.getElementById('player').pause()"> || </button>
This works perfectly when I insert it in my HTML file, but I am unsure where/how to place it so it stays between the next/prev slide controls, not resizing with the slide. 当我将其插入HTML文件中时,此方法非常有效,但是我不确定将其放置在何处/如何放置,以使其停留在下一个/上一个幻灯片控件之间,而不用调整幻灯片的大小。 Would prefer to do this with CSS and not JS.
宁愿使用CSS而不是JS做到这一点。
Thanks for any help! 谢谢你的帮助! I really appreciate it.
我真的很感激。
If you have access to the HTML, you should be able to place your button code between the next & previous buttons. 如果可以访问HTML,则应该可以将按钮代码放在下一个和上一个按钮之间。
And then to style it, you would want to either create a CSS class or use inline styles with the following attributes & values: left: 30px; top: 26px; font-size: 25px;
然后要设置样式,您可能要创建一个CSS类或使用具有以下属性和值的内联样式:
left: 30px; top: 26px; font-size: 25px;
left: 30px; top: 26px; font-size: 25px;
The full code: 完整代码:
<button class="enabled" onclick="document.getElementById('player').pause()" style="left: 30px; top: 26px; font-size: 25px;"> || </button>
It would make it look like this: 它看起来像这样:
I did try using the javascript document.getElementById('player').pause()
. 我确实尝试使用javascript
document.getElementById('player').pause()
。 It didn't seem to work. 它似乎没有用。 I couldn't find any elements that had the ID of
player
. 我找不到任何具有
player
ID的元素。 But if you've already had that working in the past, then I'm sure you'll be covered in that regards. 但是,如果您过去曾经有过这项工作,那么我相信您会在这方面受到关注。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.