Jump to content

How can I keep my scrolling marquee text on one line, and have it scroll without a pause?

Recommended Posts

On 4/7/2021 at 11:50 PM, zala said:

Site URL: https://www.downtoearthadventures.com/

Hi, I'm trying to get the scrolling marquee text to scroll continuously, without a pause and on one line. Any advice? 

https://www.downtoearthadventures.com/

pw: downtoshirts

 

Examples:

https://gawoonchung.com/about

https://fourtwocreative.com/

 

Thank you!

 

 

try if this help

<style>
#dte-weekend-adventures .Index-page-content  {
  padding-left: 0;
  padding-right: 0;
}
.marquee {
  width: 100%;
  margin: 0 auto;
  overflow: hidden;
  white-space: nowrap;
  margin-top: 17px;
}
.marquee-content {
  display: inline-block;
  margin-top: 5px;
  animation: marquee 15s linear infinite;
}
.item-collection-1 {
  position: relative;
  left: 0%;
  animation: swap 15s linear infinite;
}
@keyframes swap {
  0%, 50% {
    left: 0%;
  }
  50.01%,
  100% {
    left: 100%;
  }
}
.marquee-content:hover {
  animation-play-state: paused
}
.item1 {
  display: inline-block;
  height: 70px;
  width: 140px;
  background: cyan;
  vertical-align: top;
  margin-left: 15px;
}
.item2 {
  display: inline-block;
  height: 70px;
  width: 100px;
  background: magenta;
  vertical-align: top;
  margin-left: 15px;
  line-height: 14px;
}
/* Transition */

@keyframes marquee {
  0% {
    transform: translateX(0)
  }
  100% {
    transform: translateX(-100%)
  }
}
</style>
<div class="marquee">
<div class="marquee-content">
    <span class="item-collection-1"> Roman roads and marshmallows roasted on fire pits. Fairy tales on Snowdonia mountain trails. Bracing dips in lakes that reset. The office grind forgotten; the city air vanished.
    </span>
    <span class="item-collection-2"> Roman roads and marshmallows roasted on fire pits. Fairy tales on Snowdonia mountain trails. Bracing dips in lakes that reset. The office grind forgotten; the city air vanished.</span>
</div>
</div>

 

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
  • 3 weeks later...

Hi @bangank36 Thank you for giving it a shot.. For some reason it didn't help.

I found code elsewhere that finally got it working though. Here's the code that worked for me in case it helps anyone else:

In Code Block:

<div class="marquee">
<div class="track">
<h3> insert marquee text repeated 10-15 times here </h3>
</div>
</div>

In Custom CSS:

// MARQUEE//.marquee {
  position: absolute;
  display: flex;
  animation: moveLeft 1200s linear infinite;
}.track {
  white-space: nowrap;
  min-width: 100%;
  text-align: center;
}section[id*="dte-weekend-adventures-full"] {
 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%) }
}
Link to comment
  • 7 months later...
On 4/11/2021 at 4:32 PM, bangank36 said:

try if this help

<style>
#dte-weekend-adventures .Index-page-content  {
  padding-left: 0;
  padding-right: 0;
}
.marquee {
  width: 100%;
  margin: 0 auto;
  overflow: hidden;
  white-space: nowrap;
  margin-top: 17px;
}
.marquee-content {
  display: inline-block;
  margin-top: 5px;
  animation: marquee 15s linear infinite;
}
.item-collection-1 {
  position: relative;
  left: 0%;
  animation: swap 15s linear infinite;
}
@keyframes swap {
  0%, 50% {
    left: 0%;
  }
  50.01%,
  100% {
    left: 100%;
  }
}
.marquee-content:hover {
  animation-play-state: paused
}
.item1 {
  display: inline-block;
  height: 70px;
  width: 140px;
  background: cyan;
  vertical-align: top;
  margin-left: 15px;
}
.item2 {
  display: inline-block;
  height: 70px;
  width: 100px;
  background: magenta;
  vertical-align: top;
  margin-left: 15px;
  line-height: 14px;
}
/* Transition */

@keyframes marquee {
  0% {
    transform: translateX(0)
  }
  100% {
    transform: translateX(-100%)
  }
}
</style>
<div class="marquee">
<div class="marquee-content">
    <span class="item-collection-1"> Roman roads and marshmallows roasted on fire pits. Fairy tales on Snowdonia mountain trails. Bracing dips in lakes that reset. The office grind forgotten; the city air vanished.
    </span>
    <span class="item-collection-2"> Roman roads and marshmallows roasted on fire pits. Fairy tales on Snowdonia mountain trails. Bracing dips in lakes that reset. The office grind forgotten; the city air vanished.</span>
</div>
</div>

 

Thank you bangank36!!
it worked for me, i thought i was going crazy, nothing of the other info on the internet worked, not even javascript.

where would I be to put the h3 tag? if i open and close it with the text in between the text then appears on two lines.

Thanks again!

Link to comment

Currently i use the span tag, which h3 do you mention?

Sharing your site with protected password could help a lot

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.