简体   繁体   中英

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....

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);
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM