- This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- The forum ‘JavaScript’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › JavaScript › Simple Youtube modal not working
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??
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.
$
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);
Alen is correct, and the reason that $
is undefined is because you are calling jQuery.noConflict()
inside your minified jQuery script,
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!