Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • Bradley Barrett
    Participant

    Is there a way to use the CTA buttons to trigger a CSS selector? Right now it’s requiring a URL.

    Hi Bradley,

    Thanks for using Announcer.

    I believe you want to run some javascript when clicking CTA button right ?

    In that case you can simply create a <script> tag and add your JS under that.
    You can target the “primary” button with the below selector.

    var announcement_btn = document.querySelector('#ancr-471 .ancr-btn-primary');
    announcement_btn.addEventListener('click', function(){
        //<my code>
    });

    Replace 471 with your announcement ID and in my code use to triggger whatever needed.

    Thanks,
    Aakash

    Marking this as resolved.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Subscribe to our Newsletter

Get updates on the WordPress plugins, tips and tricks to enhance your WordPress experience. No spam. View newsletter

By using this website, you agree to our Terms