Jump to content

cradit

Member
  • Posts

    1
  • Joined

  • Last visited

cradit's Achievements

Level 1

Level 1 (1/20)

0

Reputation

  1. Site URL: https://ngapsms.com Hey All! I'm struggling with the following code: <!-- <style> .sqs-cookie-banner-v2.DARK { display: none; } </style> --> <script> //check if running gonative if (navigator.userAgent.indexOf('gonative') > -1) { //hide cookie banner $(".sqs-cookie-banner-v2.DARK").hide(); console.log("yes gonative"); } else { //show cookie banner $('.sqs-cookie-banner-v2.DARK').show(); console.log($('.sqs-cookie-banner-v2.DARK').attr('style')); console.log("no gonative"); } </script> I've loaded 3.6.0 jQuery and I'm loading this code in the footer of my site. What I find is that the jQuery selector on class' doesn't seem to work. I can select all p's or h2's tags and it works great, but using class' fails consistently. Also, the commented style does work, so it makes me feel like the class is correct. Should this work, or is there something that I'm missing?
×
×
  • 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.