How can I create an announcement bar?

Solved

How can I create an announcement bar?

MyMawduh
Excursionist
31 5 7

am using a Sense version 9.0.0

Want to make a different look to the site and have my announcement bar move like a stock market bar?

 
MyMawduh
Accepted Solution (1)
Ujjaval
Shopify Partner
1242 197 213

This is an accepted solution.

@MyMawduh 
add <marquee> </marquee> tag in announcement-bar.liquid file

Ujjaval_0-1680509864801.png

 

View solution in original post

Replies 16 (16)

oscprofessional
Shopify Partner
16115 2409 3123

Hello @MyMawduh 

Could you please provide your store URL and, if it is password protected, please share the password so I can review it and provide a solution.

Get pass your Store Core Web Vital Free Speed Optimization Audit, Chat on WhatsApp | Skype : oscprofessionals-87 | Email: pallavi@oscprofessionals.com | Hire us | Guaranteed Site Speed Optimization | Website Free Audit | Shopify Theme Customization | Build Shopify Private App | Shopify SEO | Digital Marketing | Oscp Upsell & Cross sell App : Free | Oscp Sales & Volume Discount App : Free | Custom Pricing Wholesale App : Free
MyMawduh
Excursionist
31 5 7

www.mymawduh.com

MyMawduh

Denishamakwana
Shopify Partner
1408 173 231

Hi,
Please share your store URL and if your store is password protected then also provide password too.
Thank you.

If helpful then please Like and Accept Solution. Want to modify or custom changes on store Hire me. Feel free to contact me on denishabhensdadiya@gmail.com | Shopify Design Changes | Custom Modifications In to Shopify Theme
MyMawduh
Excursionist
31 5 7

www.mymawduh.com

MyMawduh
oscprofessional
Shopify Partner
16115 2409 3123

Hello @MyMawduh 

Please refer to this URL: It might be helpful to you-

https://community.shopify.com/c/shopify-design/moving-announcement-bar/td-p/1585168

 

Get pass your Store Core Web Vital Free Speed Optimization Audit, Chat on WhatsApp | Skype : oscprofessionals-87 | Email: pallavi@oscprofessionals.com | Hire us | Guaranteed Site Speed Optimization | Website Free Audit | Shopify Theme Customization | Build Shopify Private App | Shopify SEO | Digital Marketing | Oscp Upsell & Cross sell App : Free | Oscp Sales & Volume Discount App : Free | Custom Pricing Wholesale App : Free
MyMawduh
Excursionist
31 5 7

Woow lots of code for a simple task. I kinda got lost on what to do. 

cant we just generate a CSS code to add to the announcement bar?

MyMawduh

AliReviews
Shopify Partner
773 90 356

Hello @MyMawduh ,

 

You can try to do this:

1. Go to Online Stores -> Theme -> Actions -> Edit code

Ref- step 1.png

 

2. Open the theme.liquid -> add the following code

<script>
  function ticker() {
    var bar = document.getElementById('announcement-bar');
    var width = bar.offsetWidth;
    var parentWidth = bar.parentNode.offsetWidth;
    var limit = width - parentWidth;
    var step = 1;
    var direction = -1;
    var position = 0;

    setInterval(function() {
      if (position === 0 || position === limit) {
        direction = -direction;
      }
      position += step * direction;
      bar.style.transform = 'translateX(' + -position + 'px)';
    }, 10);
  }

  document.addEventListener('DOMContentLoaded', ticker);
</script>

 

3. Save and preview

 

Hope this can help.

Ali Reviews team. 

- Was my answer helpful? Please hit Like or Mark it as solution!
- Ali Reviews - The must-have Shopify app that empowers you to effortlessly collect, display, and manage product reviews.
- Start your FREE trial today!
MyMawduh
Excursionist
31 5 7

No it did not work

MyMawduh
Ujjaval
Shopify Partner
1242 197 213

This is an accepted solution.

@MyMawduh 
add <marquee> </marquee> tag in announcement-bar.liquid file

Ujjaval_0-1680509864801.png

 

MyMawduh
Excursionist
31 5 7

it's working. can you check the site and tell me what you think, please?

I really like it on the mobile version, but on the desktop, it's slow and was thinking if I can change the color. 

MyMawduh
Ujjaval
Shopify Partner
1242 197 213

@MyMawduh you can control the speed of announcement bar using 
by adding

scrollamount="10" 

Ujjaval_0-1680511351963.png

 

MyMawduh
Excursionist
31 5 7

oh my god i completely missed everything up 😥

MyMawduh
Ujjaval
Shopify Partner
1242 197 213

@MyMawduh what happened dude?
You didn't add na 

<marquee behavior="scroll" direction="left" scrollamount="20">

for fast scrolling?

Ujjaval_0-1680519198014.png

 

 

sapiens_sapiens
Shopify Partner
19 0 2

Hello Ujjaval,
the marquee is not available in the theme, am I wrong?
I am working to achieve the same result and trying to adapt the marquee I have to my announcement bar, but it flickers by scrolling for a sec in the opposite direction. Could u pls give me a hand to fix it?

Darceycunningha
Visitor
2 0 0

Hey, for some reason i don't appear to have the code. Is it something to do with my theme? 

 

Any help appreciated 🙂

 

Screenshot 2023-09-20 at 10.46.13.png

wendaomigo
Visitor
1 0 0

hi can you copy paste this marquee code please? thank you