javascript - Issue with fancybox -


When I click on the image, I can not find a fancy box. I am new to using it, and can not understand what is wrong. I have not used javascript much, is there anything wrong with calling jQuery function?

  & lt; Script & gt; Fancybox ({type: 'iframe', autoize: false, beforeLoad: function ('Id') == 'item1') {this.width = 500; this.height = 200;} and (this.wind = 200; this.height = 500;}}}); & lt; / script & Gt; & lt; / head & gt; & lt; body & gt; & lt; div class = "pure-u-1 net-u-md-1-2" & gt; div class = " El-box "> 

Meet with our partner << HR class =" header-after "> gt; & lt; Div class = "member" & gt; & lt; p & gt; members of the diligent group! & Lt; / p & gt; & lt; / div & gt; & lt; h4 style = "font-size: x- Big; padding-left: 40px; "& gt; Harvard University & lt; / h4 & gt; & lt; a id = "item1" class = "fancybox" href = "http://fiddle.jshell.net/YtwCt/show/" & gt; & lt; img src = "CSS / Harvard Page" onclick = "fancybox ()" style = "width: 310px; height: 310px;" & gt; & lt; / a & gt; & lt; / div & gt; & lt; / Div> & lt; / body & gt; & lt; / html & gt;

Use the ready method in jquery

Example:

  $ (document) .ready (function () {$ (". Fancybox") .attr ('rel', 'gallery'). Fancybox ({type : Iframe ', auto-size: false, first load: function () (if ($ (this.element) .attr (' id ') ==' item1 ') {this.width = 500; this.height = 200; } Else {This.width = 200; this.height = 500;}}}};});  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -