I'm trying to prevent an event firing when the screen size is lower than 768px.

As the user clicks on a link, an email signup form should pop up from off-canvas, however on screens 768px and below, the contact form remains static at the bottom of the main contact.

No matter what I've tried I cannot prevent either the event firing, or some other strange behaviour, so there's clearly issues with my code.

I've made a [CodePen example](http://codepen.io/samholguin/pen/LjiyD) to show the issue...

**JS**

```
( function($) {

    var config = {};

    config.window = $(window);
    config.wWidth = config.window.width();
    config.wHeight = config.window.height();

    $(document).ready(function () {

        $(".no-svg img").each(function () {
            this.src = this.src.replace(".svg", ".png");
        });

        resizeWindow();

    });

    $(window).resize(resizeWindow);

    function resizeWindow() {
      config.wWidth = config.window.width();
      config.wHeight = config.window.height();

    if ( !Modernizr.touch && config.wWidth > 768 ) {
        buildCanvas();
      }
    }

    function buildCanvas() {

        var $container = $('.email-signup__wrap'),
            $cHeight = $('.email-signup').outerHeight();

        $('.email-signup__wrap').on('click', function(e) {

       e.preventDefault;

            var $this = $(this);

            $container.toggleClass('active');

            if ($container.hasClass('active')) {

                TweenMax.to($container, 0.4, {
                    ease: Power2.easeOut,
                    css:{
                        overflow: 'visible',
                        position: 'absolute',
                        top: -$cHeight
                    }
                });

            } else {

                TweenMax.to($container, .4, {
                    ease: Power2.easeOut,
                    css:{
                        position: 'relative',
                        top: 0
                    },
                    onComplete: hide
                });

                function hide(){
                    $container.css('overflow', 'hidden');
                }

                $("div.mce_inline_error").remove();
            }
        });
    }

})(jQuery);

```