0

My normal desktop site has links like this

<a class="various fancybox.iframe" href="template.html"><div class="text_14">Feature Article</div>  </a>

But for my phone site i need the "class" to be gone. So that the link will open as a subpage instead of a fancy box.

So i tried

@media only screen and (max-width : 480px)  {

a{
    text-decoration: none;
    class: none;
}

which doesn't work. So how do i get the class to not be displayed?

T J
  • 42,762
  • 13
  • 83
  • 138

1 Answers1

1

You need to use Javascript for removing class from HTML element Since you are using fancybox, I assume you have included jQuery too so following code should work if you open the page in mobile device.

<script>
    $(function(){
        if($(window).innerWidth() <= 480){
            $('a.various').removeClass('various').removeClass('fancybox.iframe');
        }
    })
</script>
Bhavesh B
  • 1,121
  • 12
  • 25