Hide title in Fancybox in 2 ways
by David Pham • January 13, 2015 • Blog
Hide title in fancybox is quite easy, fancybox is a very good lightbox/gallery base on jQuery with a lot of useful helpers/plugins so that we are free to control everything. Today I will show you how to hide title what is displayed as default.
The default fancybox gallery will show you the lightbox of image like this
The problem is we have too many images in our gallery, so that we don’t have time to enter the name/title for all of them, that ‘s why we want to hide all of them and use space to show bigger image. Here is the solution how to hide title in fancybox. It ‘s very easy with a simple paramater.
1 2 3 4 5 |
$(".fancybox").fancybox({ helpers : { title : null /* Title is a helper and is enabled by default, you can disable it */ } }); |
Or you can use this way
1 2 3 4 5 6 |
$(".fancybox").fancybox({ beforeLoad : function() { /* You can use callbacks to customize or disable title */ this.title = false; } }); |
Yes, they are 2 simple ways for you to hide title in fancybox.
Good luck and welcome any comment!