Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Get Safari (Lion) to hopefully always indicate & show scrollbars correctly
# CoffeeScript source
$.fn.forceScrollbars = ->
@css position: 'static'
@[0].offsetHeight if @length > 0
@css position: 'relative'
// nudge safari 5.1 to (hopefully) display scrollbars correctly
(function() {
$.fn.forceScrollbars = function() {
position: 'static'
if (this.length > 0) {
return this.css({
position: 'relative'

madrobby commented Sep 13, 2011

Note: it works often, but not always, I still have some elements that just never show the Lion-style scrollbars, or any scrollbars ftm. Any ideas are welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment