LindseyMexico14 Posted February 5, 2022 Share Posted February 5, 2022 Site URL: https://amphibian-porcupine-6hk9.squarespace.com/shop-1 Hi, I want the prices to be equal distance from the title, what code would be necessary to do this? I am talking about the image blocks, not the gallery. site: https://amphibian-porcupine-6hk9.squarespace.com/shop-1 Link to comment
codeandtonic Posted February 5, 2022 Share Posted February 5, 2022 (edited) Demo video Google Chrome – at 20.45.mp4 Paste this code to Settings -> advanced -> Code injection -> header <!-- jQuery 3 --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script> <script> document.head.insertAdjacentHTML("beforeend", `<style> /* CSS BELOW ⬇️⬇️⬇️⬇️⬇️ */ .image-caption strong { display: inline-block; } /* CSS ABOVE ⬆️⬆️⬆️⬆️⬆️ */ </style>`); $( document ).ready(function() { /** * Equal Heights Plugin * Equalize the heights of elements. Great for columns or any elements * that need to be the same size (floats, etc). * * Version 1.0 * Updated 12/10/2008 * * Copyright (c) 2008 Rob Glazebrook (cssnewbie.com) * * Usage: $(object).equalHeights([minHeight], [maxHeight]); * * Example 1: $(".cols").equalHeights(); Sets all columns to the same height. * Example 2: $(".cols").equalHeights(400); Sets all cols to at least 400px tall. * Example 3: $(".cols").equalHeights(100,300); Cols are at least 100 but no more * than 300 pixels tall. Elements with too much content will gain a scrollbar. * */ (function($) { function equalHeights (minHeight, maxHeight) { tallest = (minHeight) ? minHeight : 0; this .height('auto') .each(function() { if($(this).height() > tallest) { tallest = $(this).height(); } }); if((maxHeight) && tallest > maxHeight) tallest = maxHeight; return this.each(function() { $(this).height(tallest).css("overflow","auto"); }); } $.fn.equalHeights = function(minHeight, maxHeight) { var $this = this; $(window).resize(function(){ equalHeights.call($this, minHeight, maxHeight); }); equalHeights.call($this, minHeight, maxHeight); return this; }; })(jQuery); $(".image-caption strong").equalHeights(); }); </script> Feel free to get in touch if you need to hire a pro 🙂 Edited February 5, 2022 by codeandtonic tuanphan 1 Freelance Squarespace developer making plugins like Full-Width Blocks, Hover effects for grid gallery and the Darkmode plugin. I know Squarespace inside out and I'm able to solve pretty much any Squarespace code problem. Get in touch here! Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment