Skip to main content
jamieh2os
Known Participant
December 7, 2017
Answered

FancyBox Close Button and Click Off not working

  • December 7, 2017
  • 2 replies
  • 9976 views

I have a website I'm developing starting with one image and thumbnail first; then will be adding many possibly using php for now just html, js and css.  I have linked in fancybox and jQuery js and css, from  fancyBox site

The site is updated to SiteGround (where all files reside) to test results.  It works:  thumbnail shows, click on it and larger image appears.  But, the close button does not show and clicking off does not close large image.  I have to refresh browser to go back to thumbnail.  I have been referencing fancyBox site to build code.  I also tried

<!-- <script type="text/javascript">

$(document).ready(function() {

$(".fancybox").fancybox({

buttons: [

'zoom',

'close'

]

});

});

</script>-->

that I found from another source.  I had same results (images showing but not close button)  It seems this could be something simple because default fancybox set up shows the 'close' options on examples I have seen.  Perhaps a Z index setting or page size.    Please Help.....thanks

This topic has been closed for replies.
Correct answer osgood_

Have you included the https: in the link to the jQuery library: (It might be as simple as that)...

https://code.jquery.com/jquery-3.2.1.min.js

2 replies

Nancy OShea
Community Expert
Community Expert
December 7, 2017

If you don't see the toolbar across the top, that means your Fancybox function script is broken.  It's not invoking at all.

Below is a working demo with latest Fancybox 3.   View source to see the code.

Alt-Web Demo : Dynamic Photo Gallery with Bootstrap, PHP & Fancybox

Nancy

Nancy O'Shea— Product User & Community Expert
osgood_Correct answer
Legend
December 7, 2017

Have you included the https: in the link to the jQuery library: (It might be as simple as that)...

https://code.jquery.com/jquery-3.2.1.min.js