I am attempting to run an if/else statement depending on the value of a variable inside Bootstrap 3.1. Why isn't this code working? I have tried many variations of it, with and without return... but it will not return the right class depending on the window width. I have refreshed and checked that the value for windowwidth is both above and below 750... no change. How can I go about this within Bootstrap.js?

```
var windowwidth = $(window).width();

if (!isActive) {
 if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
   // if mobile we use a backdrop because click events don't delegate
 $('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
}

var relatedTarget = { relatedTarget: this }
$parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))

if (e.isDefaultPrevented()) return

$parent
//Code starts here//

 if (windowwidth < 750) {
  return .toggleClass('open')
 }
 else {
  return .toggleClass('otherclass')
 }
//code ends here//
  .trigger('shown.bs.dropdown', relatedTarget)

$this.focus()
}

return false
}

```