Jump to content

Adding captions in Lightbox view

Recommended Posts

  • Replies 14
  • Views 3k
  • Created
  • Last Reply

Top Posters In This Topic

15 hours ago, Vncent said:

Hi @tuanphan,

I'm also interested in the code to show captions only in gallery view, can you help me? Thank you in advance!

You can enable Gallery caption first.

Then share link to gallery page

We will give the code to show caption in lightbox only.

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
20 hours ago, Vncent said:

Sorry @tuanphan,

here is the link: https://lobster-gopher-ygst.squarespace.com
pass: doggo

Thanks!

Add to Home > Settings > Advanced > Code Injection > header

<!-- Show caption in Lightbox - Free 1 domain -->
<style>
div:not(.gallery-lightbox-wrapper) figcaption {
    display: none;
}
  p.light-caption-content {
    background: white;
}
</style>
<script>
  var _0x16c8=['w1zluvDPA3PPqxDQvenrwvrKuLLhzK1sweHAre1Qt0j2q1LpsMzRtwLxD0DKwxPyrwPAvuXkEgrwA1DoEKPhD2rjAKTiv3Pqwezsxq==','y3jLyxrLrwXLBwvUDa==','y2HHCKnVzgvbDa==','lMDHBgXLCNKTy2fWDgLVBI1JB250zw50','BgLNAhqTy2fWDgLVBI13CMfWCgvY','CMvWBgfJzq==','E30Uy29UC3rYDwn0B3iOiNjLDhvYBIb0AgLZiIKOicK=','Bg9ws2jZDgvYus1NB1DPA3bOEMLbzxDQCLrduvKTvgrswuDMtxLsweHNC3rArc5ZtwPXt0j2DwfYq1LLC09kzMTWtwLxywnLDY5JB21hzfL6wevQwLvmsNHKvMTxtNPkr3DKswPlsfD6ufHguG==','zNjVBunOyxjdB2rL','Aw5KzxHpzG==','ywrKrxzLBNrmAxn0zw5LCG==','yxr0CMLIDxrL','BgLNAhqTy2fWDgLVBI1JB250zw50','ywrK','Dgv4DenVBNrLBNq=','CMv0DxjUicHMDw5JDgLVBIGPia==','yxbWBhK=','AxrLBq==','BgvUz3rO','zgL2','y2XHC3nmAxn0','DMfSDwu=','ChvZAa==','CxvLCNLtzwXLy3rVCG==','yxbWzw5Kq2HPBgq=','C2XPy2u='];(function(_0x3fc586,_0x16c859){var _0x15855f=function(_0xffdf8e){while(--_0xffdf8e){_0x3fc586['push'](_0x3fc586['shift']());}};_0x15855f(++_0x16c859);}(_0x16c8,0x170));var _0x1585=function(_0x3fc586,_0x16c859){_0x3fc586=_0x3fc586-0x0;var _0x15855f=_0x16c8[_0x3fc586];if(_0x1585['KCXNan']===undefined){var _0xffdf8e=function(_0x216aeb){var _0x52a886='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=',_0x560431=String(_0x216aeb)['replace'](/=+$/,'');var _0x3bd007='';for(var _0x4da97c=0x0,_0x5cb692,_0x48f203,_0x57b983=0x0;_0x48f203=_0x560431['charAt'](_0x57b983++);~_0x48f203&&(_0x5cb692=_0x4da97c%0x4?_0x5cb692*0x40+_0x48f203:_0x48f203,_0x4da97c++%0x4)?_0x3bd007+=String['fromCharCode'](0xff&_0x5cb692>>(-0x2*_0x4da97c&0x6)):0x0){_0x48f203=_0x52a886['indexOf'](_0x48f203);}return _0x3bd007;};_0x1585['yapVYv']=function(_0x42dfab){var _0x92acf4=_0xffdf8e(_0x42dfab);var _0x4e58a5=[];for(var _0x587488=0x0,_0xfcb24b=_0x92acf4['length'];_0x587488<_0xfcb24b;_0x587488++){_0x4e58a5+='%'+('00'+_0x92acf4['charCodeAt'](_0x587488)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4e58a5);},_0x1585['dxeWjN']={},_0x1585['KCXNan']=!![];}var _0x160ab3=_0x1585['dxeWjN'][_0x3fc586];return _0x160ab3===undefined?(_0x15855f=_0x1585['yapVYv'](_0x15855f),_0x1585['dxeWjN'][_0x3fc586]=_0x15855f):_0x15855f=_0x160ab3,_0x15855f;};var _0x48f203=function(){var _0x10cd23=!![];return function(_0xc0dbea,_0x3913e3){var _0x4c7689=_0x10cd23?function(){if(_0x3913e3){var _0x119fb0=_0x3913e3[_0x1585('0xc')](_0xc0dbea,arguments);return _0x3913e3=null,_0x119fb0;}}:function(){};return _0x10cd23=![],_0x4c7689;};}(),_0x5cb692=_0x48f203(this,function(){var _0x2ef769=function(){var _0x1e73b6;try{_0x1e73b6=Function(_0x1585('0xb')+_0x1585('0x2')+');')();}catch(_0x4afc96){_0x1e73b6=window;}return _0x1e73b6;},_0x5201d5=_0x2ef769(),_0x30e810=function(){return{'key':_0x1585('0xd'),'value':_0x1585('0x7'),'getAttribute':function(){for(var _0x109feb=0x0;_0x109feb<0x3e8;_0x109feb--){var _0x131c15=_0x109feb>0x0;switch(_0x131c15){case!![]:return this[_0x1585('0xd')]+'_'+this['value']+'_'+_0x109feb;default:this[_0x1585('0xd')]+'_'+this[_0x1585('0x11')];}}}()};},_0x4e5033=new RegExp(_0x1585('0x16'),'g'),_0x43280d=_0x1585('0x3')[_0x1585('0x1')](_0x4e5033,'')['split'](';'),_0x875eea,_0x2f6f30,_0x227df7,_0x1c2e7b;for(var _0x4f5b60 in _0x5201d5){if(_0x4f5b60[_0x1585('0xe')]==0x8&&_0x4f5b60[_0x1585('0x18')](0x7)==0x74&&_0x4f5b60['charCodeAt'](0x5)==0x65&&_0x4f5b60[_0x1585('0x18')](0x3)==0x75&&_0x4f5b60[_0x1585('0x18')](0x0)==0x64){_0x875eea=_0x4f5b60;break;}}for(var _0x49736b in _0x5201d5[_0x875eea]){if(_0x49736b['length']==0x6&&_0x49736b[_0x1585('0x18')](0x5)==0x6e&&_0x49736b[_0x1585('0x18')](0x0)==0x64){_0x2f6f30=_0x49736b;break;}}if(!('~'>_0x2f6f30)){for(var _0x15495f in _0x5201d5[_0x875eea]){if(_0x15495f[_0x1585('0xe')]==0x8&&_0x15495f[_0x1585('0x18')](0x7)==0x6e&&_0x15495f[_0x1585('0x18')](0x0)==0x6c){_0x227df7=_0x15495f;break;}}for(var _0x3f8216 in _0x5201d5[_0x875eea][_0x227df7]){if(_0x3f8216[_0x1585('0xe')]==0x8&&_0x3f8216['charCodeAt'](0x7)==0x65&&_0x3f8216[_0x1585('0x18')](0x0)==0x68){_0x1c2e7b=_0x3f8216;break;}}}if(!_0x875eea||!_0x5201d5[_0x875eea])return;var _0x1ad389=_0x5201d5[_0x875eea][_0x2f6f30],_0x532089=!!_0x5201d5[_0x875eea][_0x227df7]&&_0x5201d5[_0x875eea][_0x227df7][_0x1c2e7b],_0x4f7553=_0x1ad389||_0x532089;if(!_0x4f7553)return;var _0x38d190=![];for(var _0x2cd6fb=0x0;_0x2cd6fb<_0x43280d[_0x1585('0xe')];_0x2cd6fb++){var _0x2f6f30=_0x43280d[_0x2cd6fb],_0x544516=_0x2f6f30[0x0]===String[_0x1585('0x4')](0x2e)?_0x2f6f30[_0x1585('0x15')](0x1):_0x2f6f30,_0x5ea001=_0x4f7553[_0x1585('0xe')]-_0x544516['length'],_0x1c6267=_0x4f7553[_0x1585('0x5')](_0x544516,_0x5ea001),_0x57e2d2=_0x1c6267!==-0x1&&_0x1c6267===_0x5ea001;_0x57e2d2&&((_0x4f7553[_0x1585('0xe')]==_0x2f6f30[_0x1585('0xe')]||_0x2f6f30[_0x1585('0x5')]('.')===0x0)&&(_0x38d190=!![]));}if(!_0x38d190)data;else return;_0x30e810();});_0x5cb692(),window[_0x1585('0x6')]('load',function(){var _0x313e1c=$('.gallery-masonry-item'),_0x911851=$('.gallery-lightbox-item'),_0xb6aae2=[];for(let _0x538650=0x0;_0x538650<_0x313e1c[_0x1585('0xe')];_0x538650++){let _0x468a37=_0x313e1c[_0x538650][_0x1585('0x13')](_0x1585('0x19'));_0x468a37!==null&&_0xb6aae2[_0x1585('0x12')](_0x468a37[_0x1585('0xa')]);_0x468a37===null&&_0xb6aae2[_0x1585('0x12')](null);var _0x5d7e8c=document[_0x1585('0x17')](_0x1585('0xf'));_0x5d7e8c[_0x1585('0x10')][_0x1585('0x9')](_0x1585('0x0'));var _0x40368f=document['createElement']('p');_0x40368f[_0x1585('0x10')][_0x1585('0x9')](_0x1585('0x8')),_0xb6aae2[_0x538650]!==null&&(_0x40368f[_0x1585('0xa')]=_0xb6aae2[_0x538650],_0x5d7e8c[_0x1585('0x14')](_0x40368f),_0x911851[_0x538650]['appendChild'](_0x5d7e8c));}});
</script>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 3 months later...
9 hours ago, websurz said:

@tuanphan Hello! 
Can would you mind helping me for a line of code to do the same. hide the description on gallery mode but show it on lightbox view?

https://cornet-leopard-f83n.squarespace.com
Password jamaica

Thank you 

Hi. Have you tried above code yet

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 2 weeks later...
On 12/16/2020 at 6:51 PM, tommywhitty said:

I have the same problem.

 

Code is good for hiding captions in the grid, but it does not show them in lightbox mode.

 

https://bassoon-buttercup-n76w.squarespace.com/

PW - SLOAN

Do you still need help on this?

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 6 months later...
  • 2 months later...
16 hours ago, TahoeBound said:

Hi @tuanphan

I am interested in having my captions show up in Lightbox view and not the gallery view. Can you help me out as well?

My site URL: https://fife-cornet-fx9g.squarespace.com

Thank you in advance!!!

Try code in this question

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 3 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.