Var currentIframe = modal.querySelector('. Many thanks! For reference, the code with your suggested script is below. Won’t ask any further questions re javascript until I’ve schooled myself in it but this was extremely helpful and I can now roll out to 50 odd other videos/modals and finally get my personal site looking the way I envisaged. I have placed your script in the appropriate places to get the videos/sound to stop when hitting the ‘x’ button or outside of the modal. Just to say thanks very much for solving this problem for me. Var modalB = document.getElementById('id02') Var modalA = document.getElementById('id01') Height: 315px /*Matches width and height of iframe but made transparent*/ Margin: 15% auto /*5% from top and centered*/ HTML5 defines subtitles as a transcription or translation of the dialogue when sound is available but not understood by the viewer (for example, dialogue in a. I should confess that while I have learned a fair amount of HTML and CSS, I’m yet to embark on javascript so I’m out of my depth here but would be fantastic if someone can help to get this particular problem out of the way. The code below is simplified but has a few of the modals/videos and demonstrates the issue. I used a W3schools modal and styled it a little, mainly just by making the modal box transparent and changing the close button (looked pretty nice and sparse in the end I thought, just in case anyone would like to use it). There is a fair bit of code available on google but I haven’t been able to adapt it. Hoping someone can help with script to prevent this. Unfortunately when the modal is closed, the youtube video continues to play (i.e. I have made a personal website with numerous modals that include youtube videos.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |