Search code examples
jqueryfancybox

Add a button to full size in fancybox v2


Currently, the only way to view an image in Fancybox in full size is calling the buttons helper, but this also brings the rest of the buttons (Play, Next, Prev, etc). I would like to add a single button to a corner of the Fancybox container that will toggle full/auto size; preferrably adding changes to the regular js and css files, to avoid additional requests. Any ideas?


Solution

  • Don't waste your time for changing javascript, you can show only close and fullsize button with this css trick.

    #fancybox-buttons a.btnPrev, #fancybox-buttons a.btnNext, #fancybox-buttons a.btnPlay {
       display:none;
    }
    
    #fancybox-buttons ul {
      width:80px;
    }