Skip to main content
jamieh2os
Known Participant
Dec 7, 2017 5:53 PM UTC
Answered

FancyBox Close Button and Click Off not working

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 is closed to new replies. Start a new post to keep the conversation going.
osgood_Correct answer
Legend
Dec 7, 2017 6:10 PM UTC

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
Dec 7, 2017 7:30 PM UTC

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

Translate
Nancy O'Shea— Product User & Community Expert
osgood_Correct answer
Legend
Dec 7, 2017 6:10 PM UTC

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

Translate