Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Simple Youtube modal not working

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #168443
    deeve007
    Participant

    Trying to get this to work on a simple site I’m doing for a friend: http://lab.veno.it/venobox/

    Site: http://cenkbaban.com/laurakingsoprano.com.au/

    It should work on the link “Laura’s showreel”, and it seems like I’ve loaded all required scripts and got link code correct, but is simply forwarding to Youtube page.

    Any ideas anyone??

    #168456
    Alan C
    Participant

    Well when I load the page I get a type error on theme.js, which looks like it is what is calling veno. This is likely the issue, your markup looks fine as far as the link goes.

    Also side note you might want to move the veno css to the head. Calling it in the body isn’t a good practice and won’t always work in every browser.

    #168461
    Alen
    Participant

    $ is undefined. Try using jQuery instead. Or do this:

    
    (function($){
        $(document).ready(function(){
            console.log('ready');
            
            $('.venobox').venobox();
            
        });
        $(window).load(function(){
            console.log('load');
        }); 
        $(window).resize(function(){
            console.log('resize');
        });
    })(window.jQuery);
    
    #168491
    Podders
    Participant

    Alen is correct, and the reason that $ is undefined is because you are calling jQuery.noConflict() inside your minified jQuery script,

    #168500
    deeve007
    Participant

    It was a little easier than that, just replaced “$(document).ready(function(){” with “jQuery(document).ready(function($) {” and it all works fine now. (and should have referred to my own parent theme’s JS file to see this bloody obvious thing!)

    Thanks a lot for the help, invaluable!!

    Cheers!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.