Jump to content

Recommended Posts

I'm testing out some code for a marquee banner. I like the look of the banner and the animation, however, it's not a continuous loop. See attached image. What I would like for it to do it just be continuous with no breaks. What have I missed?

Here's my code:

code block:

<div class="marquee">
<div class="track">
<h3> NOW BOOKING&nbsp; &nbsp; &nbsp; 
  &nbsp;·&nbsp; &nbsp; &nbsp; &nbsp;
  NOW BOOKING&nbsp; &nbsp; &nbsp; &nbsp;·&nbsp; &nbsp; &nbsp; 
  NOW BOOKING&nbsp; &nbsp; &nbsp; ·&nbsp; &nbsp; &nbsp; &nbsp;
  NOW BOOKING&nbsp; &nbsp; &nbsp; &nbsp;·&nbsp; &nbsp; &nbsp; &nbsp;
  NOW BOOKING&nbsp; &nbsp; &nbsp; &nbsp;·&nbsp; &nbsp; &nbsp; &nbsp;
  NOW BOOKING&nbsp; &nbsp; &nbsp; &nbsp;·&nbsp;NOW BOOKING&nbsp; &nbsp; &nbsp; 
  &nbsp;·&nbsp; &nbsp; &nbsp; &nbsp;
  NOW BOOKING&nbsp; &nbsp; &nbsp; &nbsp;·</h3>
</div>
</div>

css block

.marquee {
  position: absolute;
  display: flex;
  animation: moveLeft 40s linear infinite;
}
.track {
     font-size: 36px;
     min-width: 100%;
    text-align: center;
    padding:20px;
    line-height: .9em;
    color: #191c19;
    font-family: 'casanova';
    border-width:1px;
    background-color: #b1c2f6;
    border-style:solid;
    border-radius:inherit;
    white-space: nowrap;
  min-width: 100%;
  text-align: center;
}
section[id="621b04d4ad51f07b6c2a5f3e"] {
 overflow-x: hidden !important;
 overflow-y:hidden;
 min-height:initial !important;.Index-page-content {
  padding-top:30px;
  padding-bottom:30px;
}
}@keyframes moveLeft {
  from { transform: translateX(0%) }  to { transform: translateX(-100%) }
}

Screen Shot 2022-02-27 at 1.31.51 AM.png

Link to comment
  • Replies 4
  • Views 2.4k
  • Created
  • Last Reply

Top Posters In This Topic

18 hours ago, jessmall said:

I'm testing out some code for a marquee banner. I like the look of the banner and the animation, however, it's not a continuous loop. See attached image. What I would like for it to do it just be continuous with no breaks. What have I missed?

Here's my code:

code block:

<div class="marquee">
<div class="track">
<h3> NOW BOOKING&nbsp; &nbsp; &nbsp; 
  &nbsp;·&nbsp; &nbsp; &nbsp; &nbsp;
  NOW BOOKING&nbsp; &nbsp; &nbsp; &nbsp;·&nbsp; &nbsp; &nbsp; 
  NOW BOOKING&nbsp; &nbsp; &nbsp; ·&nbsp; &nbsp; &nbsp; &nbsp;
  NOW BOOKING&nbsp; &nbsp; &nbsp; &nbsp;·&nbsp; &nbsp; &nbsp; &nbsp;
  NOW BOOKING&nbsp; &nbsp; &nbsp; &nbsp;·&nbsp; &nbsp; &nbsp; &nbsp;
  NOW BOOKING&nbsp; &nbsp; &nbsp; &nbsp;·&nbsp;NOW BOOKING&nbsp; &nbsp; &nbsp; 
  &nbsp;·&nbsp; &nbsp; &nbsp; &nbsp;
  NOW BOOKING&nbsp; &nbsp; &nbsp; &nbsp;·</h3>
</div>
</div>

css block

.marquee {
  position: absolute;
  display: flex;
  animation: moveLeft 40s linear infinite;
}
.track {
     font-size: 36px;
     min-width: 100%;
    text-align: center;
    padding:20px;
    line-height: .9em;
    color: #191c19;
    font-family: 'casanova';
    border-width:1px;
    background-color: #b1c2f6;
    border-style:solid;
    border-radius:inherit;
    white-space: nowrap;
  min-width: 100%;
  text-align: center;
}
section[id="621b04d4ad51f07b6c2a5f3e"] {
 overflow-x: hidden !important;
 overflow-y:hidden;
 min-height:initial !important;.Index-page-content {
  padding-top:30px;
  padding-bottom:30px;
}
}@keyframes moveLeft {
  from { transform: translateX(0%) }  to { transform: translateX(-100%) }
}

Screen Shot 2022-02-27 at 1.31.51 AM.png

You can get reference from:

 

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox, video lightbox and much more)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 No-code customisations for Squarespace (+100 Spark plugin customisations)
🥳 Freemium Squarespace Widget Templates (+1000 Elfsight 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
On 3/1/2022 at 1:02 AM, jessmall said:

Hey thanks, I tried this code,  and it works - but isn't a continuous loop. I'm looking for it to have zero breaks or pauses. 

Try this guide https://ryandejaegher.com/easy-scrolling-text-in-squarespace/

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
  • 1 year later...

hey @jessmall I just installed on my own website.  Basically try following these steps:

1. Insert marquee

2. reduce width of marquee to button-width, you can do so by using the handles

3. Change the background color in CSS with the selector .Marquee (you can also apply a border, border-radius, and other things to disguise this marquee as a button)

4. Change the font color in CSS with the selector .Marquee *

5. Go into your block settings and be sure to link your marquee to the appropriate page,

6. Pro Tip- If you just want one or two of these on your website, be sure to add the Block ID before your selector in CSS.  

***Example below***

#block-yui_3_17_2_1_1705517217512_9343{
  .Marquee * {
   font-family: 'GothamBold' !important;
    font-size: 1.2rem;
   color:black;
    margin: .35rem;
}
  .Marquee{
      background-color: #daff60;
      border: 3px solid black;
    border-radius: 50px;
  }
}

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.