jxson
9/13/2011 - 11:40 PM

Get Safari (Lion) to hopefully always indicate & show scrollbars correctly

Get Safari (Lion) to hopefully always indicate & show scrollbars correctly

// nudge safari 5.1 to (hopefully) display scrollbars correctly

(function() {
  $.fn.forceScrollbars = function() {
    this.css({
      position: 'static'
    });
    if (this.length > 0) {
      this[0].offsetHeight;
    }
    return this.css({
      position: 'relative'
    });
  };
}).call(this);
# CoffeeScript source

$.fn.forceScrollbars = ->
  @css position: 'static'
  @[0].offsetHeight if @length > 0
  @css position: 'relative'