Jump to content

Amadeo75

Circle Member
  • Posts

    4
  • Joined

  • Last visited

Everything posted by Amadeo75

  1. @tuanphan My captions on lightbox only no longer display. Can you take a look at the code and let me know if there is a fix? https://www.charlielasansky.com/90s-drawings here is the code I am using: <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script> <script> jQuery(document).ready(function($){ $('.gallery-lightbox-list .gallery-lightbox-item').each(function(){ var text = $(this).find('img').attr("alt"); console.log(text); $(this).append('<div class="tlightbox-caption">' + text + '</div>'); }) }) </script> <style> .tlightbox-caption { color: #656565; margin: 10px 0; text-align: center; display: none; position: absolute; bottom: -45px; z-index: 9999; } .gallery-lightbox-wrapper { cursor: pointer; } .gallery-lightbox-item[data-in='false'] .tlightbox-caption { display: none!important; } .gallery-lightbox-item[data-active='true'] .tlightbox-caption{ display: inline-block; } .gallery-lightbox-wrapper:hover .gallery-lightbox-item[data-active='true'] .tlightbox-caption{ display: inline-block; } </style> Any help would be greatly appreciated. Thanks! Amadeo
  2. @tuanphan No worries! I have not solved making the captions positioned relative to the media area, especially on mobile. Thanks for checking in - Amadeo
  3. @tuanphan Thank you for the style code to load the caption automatically on lightbox, instead of on hover. Works great! As far as moving the caption closer to the image or making it relative to the image, editing the bottom value doesn't work on mobile because when you move it up on mobile, the caption moves into the image on desktop. Is it possible to make the caption relative to the image, only on mobile? Any thoughts? Thanks again for the styling code! Much appreciated. Amadeo
  4. site: https://www.charlielasansky.com/90s-drawings Hi there - I have successfully used this code injection to add captions to the lightbox only. Thank you! I wanted to make 2 changes and I am unable to figure out how to do it, any help would be much appreciated @tuanphan and @creedon 1) I was hoping to make the captions display automatically in the lightbox, not just on :hover, but so they load with the image and there is no need to :hover 2) Is it possible to make the captions sit directly under the image, or be relative to the image? On mobile, the captions are at the bottom of the screen. Here is the code I am using: <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script> <script> jQuery(document).ready(function($){ $('.gallery-lightbox-list .gallery-lightbox-item').each(function(){ var text = $(this).find('img').attr("alt"); console.log(text); $(this).append('<div class="tlightbox-caption">' + text + '</div>'); }) }) </script> <style> .tlightbox-caption { color: #656565; margin: 10px 0; text-align: center; display: none; position: absolute; bottom: -45px; z-index: 9999; } .gallery-lightbox-wrapper:hover { cursor: pointer; } .gallery-lightbox-item[data-in='false'] .tlightbox-caption { display: none!important; } .gallery-lightbox-item[data-active='true']:hover .tlightbox-caption{ display: inline-block; } .gallery-lightbox-wrapper:hover .gallery-lightbox-item[data-active='true'] .tlightbox-caption{ display: inline-block; } </style> Again - thank you for any help! Amadeo
×
×
  • 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.