graphicultra Posted December 19, 2023 Share Posted December 19, 2023 Looking to add a video, that I can replace later, into the first dropdown of my accordion menu. Any advice is appreciated. Link to comment
tuanphan Posted December 21, 2023 Share Posted December 21, 2023 First, add a Markdown Block under Accordion Block > Paste this code <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script> $(document).ready(() => { const list = $('.accordion-block p:contains("mp4")'); for (let i=0; i<list.length; i++) { const link = $(list[i]).text() $(`<video src="${link}" loop autoplay>${link}</video>`).insertAfter(list[i]) } for (let i=0; i<list.length; i++) { $(list[i]).remove() } }) </script> Next, edit First accordion >> Paste video URL (mp4) Result Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
graphicultra Posted December 30, 2023 Author Share Posted December 30, 2023 For some reason this isn't working for me. I have added the markdown block underneath the accordion block. Perhaps it is because I have updated to the next level higher than the personal plan (the business plan?) Here is the website: https://www.benscott.actor/ password: abc Also, do I have to host the .mp4 file at a specific URL, or can it be on Vimeo? Please let me know! Thanks Link to comment
tuanphan Posted January 1 Share Posted January 1 On 12/31/2023 at 1:56 AM, graphicultra said: For some reason this isn't working for me. I have added the markdown block underneath the accordion block. Perhaps it is because I have updated to the next level higher than the personal plan (the business plan?) Here is the website: https://www.benscott.actor/ password: abc Also, do I have to host the .mp4 file at a specific URL, or can it be on Vimeo? Please let me know! Thanks You need to host mp4 somewhere (you can upload to Squarespace) to get video direct url With Vimeo, you need to use paid plan to get direct video url Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
graphicultra Posted January 1 Author Share Posted January 1 Awesome! It is working. Is there any way for the user to pause, or have any playback controls for the video? It seems to just be looping from the second the accordion tab is opened. Link to comment
tuanphan Posted January 2 Share Posted January 2 Change this line src="${link}" loop autoplay to this src="${link}" loop autoplay controls Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
Sissily Posted Wednesday at 06:05 AM Share Posted Wednesday at 06:05 AM Hi Tuan -- Can you help me understand what you mean by, "First, add a Markdown Block under Accordion Block " ? I hope to place an embedded video into my accordion, but was unable to figure out where to put that code you offered. Ty! Link to comment
tuanphan Posted 16 minutes ago Share Posted 16 minutes ago On 10/2/2024 at 1:05 PM, Sissily said: Hi Tuan -- Can you help me understand what you mean by, "First, add a Markdown Block under Accordion Block " ? I hope to place an embedded video into my accordion, but was unable to figure out where to put that code you offered. Ty! Use Markdown if you have Personal Plan, but if you use Business Plan/higher, no need to add it. Also, I wrote this new guide, you can follow it Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment