Jump to content

Need to swap order of the section/blocks

Recommended Posts

  • Replies 2
  • Views 325
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted Images

On 2/3/2022 at 1:42 PM, kam_2kbk said:

Site URL: https://www.reklaimyours.com/browser-test

hey guys, so for the landing page, i was thinking to rearrange the order of text and image for 2nd section. Currently in mobile it shows 

text > image 
Image > Text 
Text > image 

Thanks! 

Try adding to Home > Settings > Advanced > Code injection, choose footer

<script>
  (function() {
    window.addEventListener('DOMContentLoaded', () => {
      const configId = 'section[data-section-id="61f1f6acb09f6979e06a4e81"]';
      const sectionConfig = document.querySelector(configId);
      const nextSectionConfig = document.querySelector(`${configId} + section`);
      if(sectionConfig && nextSectionConfig) {
        const copyConfigSection = nextSectionConfig.cloneNode(true);
        copyConfigSection.classList.add('mobile-section');
        sectionConfig.insertAdjacentElement('beforeBegin',copyConfigSection);
      }
    });
  })()
</script>

<style>
  @media only screen and (min-width: 768px) {
    .mobile-section {
      display: none;
    }
  }
  @media only screen and (max-width: 767px) {
    section[data-section-id="61f1f6acb09f6979e06a4e81"] + section {
      display: none;
    }
  }
  <style>

Let me know how it works on your site

Support me by pressing 👍 if this useful for you

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment

My testing

image.png.75e95383030adfb81aa47deb7adad698.png

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment

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.