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
Post a Comment