javascript - Fancybox creating error in Chrome -


i have 2 pages, both of using fancybox jquery lib. 1 page works, no errors. other page (which has identical (i think) syntax) producing error. only occurs in chrome.

here working code:

        $('.fancybox').fancybox({             'type'          : 'inline',             'minwidth'      : 920,             'minheight'     : 700,             'width'         : '90%',             'height'        : '90%',             'autosize'      : false,             'fittoview'     : true,             'margin'        : 15,             'padding'       : 5,             'closeeffect'   : 'fade'         }); 

and failing code:

        $(document).ready(function({         $('.fancybox').fancybox({             'type'      : 'inline',             'autosize'  : false,             'width'     : 50,             'height'    : 100,             'margin'    : 10,             'padding'   : [25,25,300,0]         });     }); 

the error coming in chrome console is: uncaught syntaxerror: unexpected string

the line of code underlined problem is: $('.fancybox').fancybox({

your error not the fancy box, in $(document).ready(function({...})). forgot closing bracket in .ready() function after arguments.

change to:

$(document).ready(function() {     $('.fancybox').fancybox({         'type'      : 'inline',         'autosize'  : false,         'width'     : 50,         'height'    : 100,         'margin'    : 10,         'padding'   : [25,25,300,0]     }); }); 

Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -