I am trying to add a setTimeout function on the close of my Fancybox. When I try this, the code breaks. Can anyone tell me what I am doing incorrect?
<script type="text/javascript">
$(document).ready(function(){
$(".popFrame").fancybox({
'height' : 600,
'autoScale' : false,
'transitionIn' : 'elastic',
'transitionOut' : 'elastic',
'speedIn' : 600,
'speedOut' : 200,
'type' : 'iframe',
'scrolling' : 'no',
'autoDimensions' : false,
'width' : 620,
'hideOnContentClick' : false,
'onClosed':function(){
$('#hidden').load('file.php');
}
setTimeout(function(){
$("div.color").fadeOut("slow", function () {
$("div.color").remove();
});
},
4000);
);
;})
</script>
The Error I’m getting is:
missing } after property list
[Break On This Error] setTimeout(function(){
You had some syntax errors in your code:
I hope this helps.