1. PROMO Subscribe our All Access Pass @ 75% OFF & access all our 16+ premium Divi extensions: Divi Block Pro, Carousel Toolkit, etc.LEARN MORE
Dismiss Notice
NEW Divi.Help Pro Carousel AI Toolkit - Magically turn your Divi design into carousel, simply by using our online toolkit. No plugins needed. Now it works with Divi 5 as well!Try our carousel AI toolkit
BEST Divi Block - A revolutionary drag & drop tool to easily mix & match 960+ premade blocks (Light & Dark) to kick start your Divi site design. Special module designs are included as well. Also newly added AI generator & color. Now it works with Divi 5 as well!
Learn More About Divi BlockFree Version ~ 340+ Free Blocks

code module - jquery

Discussion in 'Free Divi Community Forum' started by Joost van bilsen, May 27, 2023.

  1. Joost van bilsen

    Joost van bilsen New Member

    I want every day a new video on a page and therefore i create this code. I placed it in the code snippet but no the tekst is given. What I am doing wrong:
    thanks in advance

    Josot


    jQuery(document).ready(function($) {
    function ImageArray(n) {
    this.length = n;
    for (var i = 1; i <= n; i++) {
    this = ' ';
    }
    }
    var image = new ImageArray(7);
    image[0] = 'src=""';
    image[1] = 'src=""';
    image[2] = 'src=""';
    image[3] = 'src=""';
    image[4] = 'src=""';
    image[5] = 'src="https://www.youtube.com/embed/cNUWMT4eD5Y"';
    image[6] = 'src="https://www.youtube.com/embed/gKOWwbSZKmA"';
    var currentdate = new Date();
    var imagenumber = currentdate.getDay();
    var iframeHTML = '<iframe width="560" height="315" ' + image[imagenumber] + ' title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>';
    $('.your-div-class').append(iframeHTML);
    });
     
    1. PRO MEMBER PERKS Divi Block Pro - Powerful Divi header builder for you to mix & match premade header design, mobile menu & more:Learn More