Suggest a Snippet Login Register
  • LOG IN:

    Not a member? JOIN NOW!
     Username                   Password
    Remember me Recover password
DevSnippets Design Community & Snippets Gallery
  • Subscribe by RSS
>
  • Webdesign
    • Design
    • HTML5
    • lists
    • Menu
    • Navigation
    • Portfolio
    • Showcase
    • Template
    • Tooltip
    • Tutorial
    • webdesign
  • Web development
    • AJAX
    • CodeIgniter
    • CSS
    • CSS3
    • Database
    • Javascript
    • jQuery
    • Mootools
    • MySQL
    • PHP
    • PHP Framework
    • plugins
    • WordPress
    • WordPress Hacks
  • Inspiration
    • Fonts
    • Icons
    • Inspiration
    • Mac
    • Mac apps
    • Photography
    • Wallpapers
  • Snippets
In {CSS Techniques/ IE Hacks} -9th Sep-

IE Overflow fix (jQuery)

The Problem

What I hadn’t realised (though kicking myself for not realising earlier) is that IE has a different implementation of overflow compared to Firefox or Safari.

In particular, Firefox et al, when overflowing an element, it puts the horizontal overflow scroll bar on the outside of the element.

The Solution

It’s worth noting that I can only see this being a problem for horizontal overflow. Vertical overflow is always inside the element, and if you have a specific fixed height for your overflowing elements, you’ll probably want to skip step (3) below.

So our solution is to apply the following to in IE only:

1. Find all elements whose contents is overflowing horizontally.
2. Add 20 pixels of padding to the bottom of our element†.
3. Strip the vertical scroll bar.

† As far as my testing has seen, the typical height of a scroll bar is 20 pixels.
JavaScript to the Rescue

Disclaimer: As much as I’d love to see this problem solved entirely using CSS, or even the browser doing the job, I can’t see how it can be achieved uniformly across all elements, since we only want our changes to apply if, and only if the overflow has occurred (i.e. if we added the padding across the board, some blocks would appear to have an odd blank line when it didn’t overflow).

Direct Link →
chosen

Category: CSS Techniques, IE Hacks

No Comments, Add Comment or Ping


This comment thread is closed. If you want to share any information, please contact us.

  • Tabs (28)
  • Forms (133)
  • Menu (64)
  • Tables (9)
  • Navigation (36)
  • ToolTips (23)
  • LightBox (41)
  • Calendar (9)
  • AutoComplete (13)
  • Accordion (15)
  • Sliders (40)
  • Gallery (84)
  • Image Effects (62)
  • Date & Time (16)
  • Charts (16)
  • Carousel (12)
  • Tag Clouds (1)
  • Links (1)
  • Layouts (83)
  • IE Hacks (19)
  • Image Sprites (7)
  • Sliding Door (7)
  • Techniques (84)
  • Image Effects (17)
  • Font Styles (22)
  • Positioning (5)
  • Menus (43)
  • Rounded Corner (20)
  • Tools (1)
  • Drop Shadows (1)
  • CSSFrameworks (2)
  • Mootools (85)
  • jQuery (344)
  • Prototype (23)
  • Scriptaculous (10)
  • Javascript (126)
  • javascript Framework (1)

Sponsored Ads

ADVERTISE HERE

Sponsored Ads

Code & Design Snippets

Jun/22/2010
How to Style Individual Wordpress Posts...
Matt
WordPress
Jun/22/2010
50 Must Have HQ Typography Wallpapers
lava360 blog
Jun/21/2010
Tutorial: Wordpress 3.0 Custom Post...
Jared Thompson
WordPress
Jun/19/2010
How to Create a Redirect Page Template...
Eko Setiawan
WordPress
Jun/17/2010
Become a WordPress Expert with these...
Dennis
Jun/13/2010
Everything a Web Designer Should Know...
Webanddesigners
Jun/13/2010
Building a live news blogging system in...
webia
Jun/13/2010
5 Reasons Gravity Forms Makes Your Form...
Matt
WordPress
Jun/13/2010
Free Plugin : DynamicWP Image Cube
Eko Setiawan
WordPress
Jun/13/2010
Free Wordpress Themes Green Eco Design
templates4all
WordPress
Jun/13/2010
Simple CSS3 Dropdown Menu
hdytsgt
Jun/07/2010
10 Resources to Help You Create a...
Matt
WordPress
Jun/06/2010
Animated Navigation Menu with CSS3
vikas ghodke
Jun/06/2010
FIFA 2010 WordPress Theme
Vinay
WordPress
Jun/06/2010
CSS font size: Is relative sizing still...
Chet
More Code Snippets →

Design Community News

  • Is It Worth Shifting To Photoshop CS5?

    SloDive
    Jul/04/2010
  • Free Wordpress Theme Vector Nature Template

    templates4all
    Jul/04/2010
  • Best jQuery plugins – June 2010

    Spider8411
    Jun/22/2010
  • Freebies: Vintage Mega Pack 10 Samples from Designious.com

    Doink
    Jun/22/2010
  • CSS3 Animations, the Power Back to CSS Part 1: Transitions

    Teylor Feliz
    Jun/22/2010
  • Create a Photo-Realistic Candle with Basic Photoshop Tools

    Frank
    Jun/22/2010
  • Credit cards and payment icon set

    icon sets
    Jun/22/2010
  • 40 Refreshing Nature Inspired Web Designs

    Brukhar
    Jun/22/2010
  • How to Create a Tumblr Theme (Code Structure)

    Dainis Graveris
    Jun/21/2010
  • The Simple Photoshop CS5 Cheat Sheet

    Frank
    Jun/21/2010
More News →

Our Friends

  • Graphic Design School

  • MoreTechTips

  • Designm.ag

Top ↑

Add a Snippet / Design News

© 2008-2010 DEVSNIPPETS | Made by Noura Yehia | Submit Snippet | About| Subscribe | Advertise
In partnership with (mt) Media Temple