Wrest
Wrest

Reputation: 51

Facebox time delay once page load I keep getting jQuery.facebox

this is what i started with

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="inc/facebox/src/facebox.css" /> 
<script type="text/javascript" src="inc/facebox/src/facebox.js"></script> 



 <script type="text/javascript"> 
    jQuery(document).ready(function($) { 
        jQuery.facebox('hello'); 


    }) 
</script> 

this is the code im using to delay

<script type="text/javascript"> 
$(document).ready(function(){
    timeOut();
});

function timeOut() {
    var t = setTimeout("showPopup();", 3000);
}

function showPopup() {
    jQuery.facebox('hello');
}
</script> 

i keep getting Uncaught TypeError: jQuery.facebox is not a function

im not sure what im doing wrong, the on page load works fine....

Upvotes: 0

Views: 175

Answers (1)

Wrest
Wrest

Reputation: 51

Not sure what the issue is so if you see this and can spot it please leave a message so we can learn something

I did it a different way

I used the facebox with a click function and had jquery click it after page load

$("document").ready(function() {
    setTimeout(function() {
        $("#backface").trigger('click');
    },3000);
});

Upvotes: 0

Related Questions