Jump to content

Megalomaniac

Member
  • Posts

    38
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. @Towns - Im sorry, ive been very far removed from this all. I hope you were able to find a solution. Multi languages sounds like multi pages for each language or is their a way to convert all text into what ever language?
  2. What i had to do was a lot of trial end error, and this is just what you all need to do, keep trying until you get it! I wish you all the best and ill try to be more active on here in the future.
  3. Maybe Stephen's @shrothermel post about the ajax scrolling is a good idea. i'd look into that. Or maybe the solution that @logaritym provided in 2017 has better results for your needs. I wish i could be more helpful, but today i'm a little behind on what i was doing back then. I feel i'd have to relearn it all over, and i just may have to as im getting ready to revamp my site with all new work and make it more "architecturally minimalist" in feel.
  4. What i can do is share with you all my site. And maybe you all can look at the code from the specific pages where i use the show hide, but i believe it is all the same as was posted years ago, which can be found under the resume section. Now, i know that, not everyone wants to produce the identical solution, as mine is much simpler and only contains text whereas some of you are looking to add a bit more to this, ie galleries, and i don't think the code has ever worked for that. here is my site: www.anthonyashford.com and the password to it is: confidential
  5. Also if we look at the original post i spoke about, under exceptions, about Multiple injections on a page or index doesn't work. This was a big thing i found causes many issues.
  6. wow... I think i started a square space monster a long time ago! SORRY, Ive been gone for a while everyone, working crazy hrs, but now I seem to have a lot of free time! Never even thought to look back here until i got an email the other day! I must have spent hundreds of hours learning how to do some coding back then, and i profess that i am not a coder. but anything is possible i guess. I truly forget a lot about what i learned back then, but recall that adding galleries and summaries were a problem, and also recall that no one had a solution, and i couldn't figure it out then.
  7. I do know it did not like placing the code in each page, if there were multiple pages within an index that had the code, it was preferred to be in the main header code injection and then it worked. I would imagine that if you had multiple buttons within a page, that you would also need to place it in the main header code injection as well. I prefer that anyways, since you only have to do it once!
  8. JimmyP, Not sure I understand what your asking. Are you suggesting a show more/show less button within a group of blocks already in a show more / show less containment? If so, not sure if the code would work like that, might get confused, but if I were you, I'd just test it out to see if it works, and let us know.
  9. Sorry, I'm just getting back to you now.Can you send me a link to review? Your creating the button and hidden content in a 'page' right? Is the page in a grouping of other pages in an index, if so, i'd place the code in the 'main header code injection' after any other code you have placed. Oh you know what, check to see if you have the ajax script in there too. This is needed as the primary function to understand the code. <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> This ajax script, above, should go before the main code. Place this In the 'main header code injection'. the #expand-3 for the button url, count the quantity of blocks you have in the page you want to hide, below the button, replace the number of blocks with your 3, unless ofcourse its 3 blocks!Note: if you have multiple paragraphs started as multiple blocks, but then join them, the multiple paragraphs may count as one block. you'll have to test the quantity with your content.
  10. Hi All, Still looking how to fix the code to work for the other galleries and summaries. I was playing around with the other 3 Summary blocks, (Carousel, List & Grid) & their Layout settings. Ive managed to get ALL Summaries to Work with the script above. However, ONLY IF: Aspect Ratio is set to 'AUTO'. I'm wondering if the images aren't loading when the aspect ratio is set to 1:1 or 2:3 or 16:9 etc, because I need to embed something in the code to allow the wrapped images to load??? Note: There is no Auto selection for Galleries, so this doesnt work the same as a fix, but Im a bit confused as to why the Gallery Carousel and Stacked do work. Best to you all, Megalo
  11. Hi All, Megalo is back! First... Ignore the previous code I submitted, and use this if your looking to add a Show More / Show Less feature to your squarespace site! OK... We have a pretty good solution, however there seems to be some limitations to the code, but only in respect to Squarespace's pre-coded galleries and summaries. I have tested it with text and single images and it works great. Unfortunately when I got to testing squarespace's galleries and summaries, the code was only successful for summaries in the 'wall' design format and galleries in the 'carousel' & 'stacked' design format. Any other design format for both galleries and or summaries will result in them not pre-loading. (blank) I believe this is something that would take some considerable work for Squarespace to get all galleries and summaries design formats to work accordingly with this simple code, and would like all to request this fix. Instructions:You can inject the code in the main header code injection, or the index header or individual pages or even at the base of a page, before where you want the page to show/hide. Exceptions: When placing at the base of a page in an index of multiple pages, where you want the function to occur more than once, its best to just inject the code in the Index's advanced settings, instead. Multiple injections on a page or index doesn't work. So just have it done once. Hope that makes sense! Additionally: The function will require a button of course. Using squarespace's button, add at the top of where you want the Show More / Hide More location to start. The "Text" area should read: 'Show More' and the "Click Through URL" should read '#expand-(number of blocks here)' (example: #expand-3 This will collapse the next three blocks.) <script> /* This script is a custom script to control the 'show' / 'hide' extra feature. To use: give each button you want to make an expander an href of "expand-3", if you want it to expand / collapse the next 3 blocks. Make sure to make each button say 'Show More' as its default text. */ var SHOW_MORE = 'Show More' var COLLAPSE = 'Show Less' $(window).load(function(){ // prepares all buttons by wrapping the correct # of following divs into a div with class 'extra_gallery' $('a[href^="#expand"]').each(function(){ // parse # of sibling elements to wrap from href attribute and then wrap them. var n = parseInt($(this).attr('href').split('-')[1]); var next_n_divs = $(this).parents('div.sqs-block').nextAll().slice(0,n) // this is the line that is different. we use display:none; on the DOM element that wraps the additional gallery. next_n_divs.wrapAll('<div class="extra-gallery" style="display:none;"></div>'); /* // preload_images next_n_divs.find('img').each(function(){ image = new Image(); image.src = $(this).attr('data-src')+'?format=500w'; console.log($(this).attr('data-src')); }); // control for click behavior */ $(this).click(function(){ var target_gallery = $(this).parents('div.sqs-block').next('div.extra-gallery') if (target_gallery.is(':visible')){ $(this).text(SHOW_MORE); } else { $(this).text(COLLAPSE); } target_gallery.slideToggle(); return false; }); }); }); </script> Special Thanks & Coding by: Jim Li
×
×
  • 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.