Code

If IE Add Class

If a browser is recognized as IE this will add a class as you need on Webflow. This is a helpful way of hiding or showing elements, fixing IE issues and other features for IE based browsers.

If IE Add Class preview

If a browser is recognized as IE this will add a class as you need on Webflow. This is a helpful way of hiding or showing elements, fixing IE issues and other features for IE based browsers.

How to add it

  1. Add the script to your pages closing body custom code section

The code

Javascript
                      <!-- Add to your closing body section -->
<script>
$(function(){

  if (/MSIE (\d+\.\d+);/.test(navigator.userAgent) || !!navigator.userAgent.match(/Trident.*rv\:11\./)){ 
    $(".class").addClass("ie");
  }
  
});
</script>

                    

Browse similar code snippets

Categories

Language

More from Corey Moen

Profile →

Similar code snippets

All code snippets →