where is the API support documentation? need help adding code to a code snippet
-
so halfway down the links to JS API Overview and Code Generator return a 404 error. i did leave a message with the customer support sales side of things on divimode.com.
what I need help with is adding some code to a snippet i have that autoruns a video in a popup when the popup is triggered and it auto closes the popup when the video ends. however I have a couple of pages that also have a divi section background video. and im seeing some performance glitches. so i am aiming to add some code that pauses the background video when the popup is triggered.
I did find this snippet that pauses a background video on mouse hover so i think i am on the right track.
<script> window.onload = function() { let videoBg = document.getElementsByClassName('mejs-mediaelement')[0].firstElementChild.firstElementChild; let bg = document.getElementsByClassName('et_pb_section_video')[0]; videoBg.pause(); bg.addEventListener('mouseover', function() { videoBg.play(); }); bg.addEventListener('mouseleave', function() { videoBg.pause(); }); } </script>
so this tests out good on my pages.
here is my code snippet
<script> jQuery(document).ready(function ($) { homeVideoElement1 = $("#divi-video-container1 video")[0]; homeVideoElement2 = $("#divi-video-container2 video")[0]; DiviArea.addAction('show_area', function(area) { if (area.hasId('sim-intro')) { homeVideoElement1.play(); } if (area.hasId('libraryintro')) { homeVideoElement2.play(); } // console.log('im open'); }); $('video').on('ended',function(){ //console.log('Video has ended!'); $('a.da-close').trigger('click'); }); }); </script>
could someone help me with some code to add to my snippet to pause the background video?
The page I need help with: [log in to see the link]
- The topic ‘where is the API support documentation? need help adding code to a code snippet’ is closed to new replies.