Note that there are some explanatory texts on larger screens.

plurals
  1. POCSS padding dissapears in IE8/jquery
    primarykey
    data
    text
    <p>this is an odd one, that has eaten a lot of hours of my time. Here's a photo since i can only put 1 link: <a href="http://www.screencast.com/t/byVmPE6H" rel="nofollow">http://www.screencast.com/t/byVmPE6H</a> . Explanations follow.</p> <p>Basically, what i need to achieve is point 1 in the photo.</p> <p>Please notice that the left padding is larger than the right one. The initial padding property is: </p> <p><code>padding: 12px 15px;</code> (i.e. 12px vertical padding, 15px horizontal). </p> <p>Then, via jquery, on page load, i set the left padding to some value like so: </p> <p><code>$(links[0]).attr("style","padding-left : "+padding+"px;");</code> (i could've used .css(), the effect and problem remain the same)</p> <p>This works beautifully in all browsers, you guessed right, except IE. I'm not talking about versions 6 or 7, but only IE 8. So, in IE 8, on page load, i get point 2 from the photo above.</p> <p>Remember, that happens only on page load. After i go with the pointer over the link (i.e. triggering the mouseover event), the right padding jumps back into place and it looks perfect, just like in the first link (actually that first photo is from IE8!). </p> <p>Eliminating the jquery line above doesn't trigger the same behavior, the 15px paddings are ok. There's no event handler registered for "mouseover" on the links. There's only this css property for mouseover:</p> <p><code>#navigation li.first:hover a{</code></p> <p><code>background: transparent url(../images/menu_on_left.png) left top no-repeat;</code></p> <p><code>}</code></p> <p>(i.e. only a background image change, absolutely nothing else)</p> <p>So, when page loads, if i use jquery to change the left padding, the right one dissapears. On mouse over, the right padding pops back into view. I cannot explain myself why this happens. If i can't find a solution i'm actually thinking of computing the position of all the menu items and arranging them with position: absolute. Sounds really bad, i know.</p> <p>Can anyone enlighten me please?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload