4 Скругленные углы для IE делаем через VML:roundrect
5 - требуется определенный IEBorderRadius
7 Убираем наш блок z-index = -1 на задний фон и растягиваем под родителя.
13 runtimeStyle
.zoom
="1", /* one-time called expression, at the same time declare hasLayout */
14 this
.ROUNDfix
= function
(obj
){
16 /* Подготавливаем ноду и ставим ей атрибуты */
17 var round
= document
.createElement
("v:roundrect");
18 round
.fillColor
= round
.strokecolor
= obj
.currentStyle
.backgroundColor ? obj
.currentStyle
.backgroundColor : "white";
21 Вешаем создание ноды и пересчет углов на onload иначе IE6,7 будут валиться.
22 Если все прошло удачно, то убиваем background, чтобы небыло видно скачка в отрисовке
24 window
.attachEvent
("onload", function
(){
25 round
.arcSize
= obj
.offsetWidth
< obj
.offsetHeight ? parseInt
(obj
.currentStyle
.IEBorderRadius
) / obj
.offsetWidth : parseInt
(obj
.currentStyle
.IEBorderRadius
) / obj
.offsetHeight
;
26 obj
.appendChild
(round
);
27 obj
.runtimeStyle
.backgroundColor
= "transparent";
31 На onresize вещаем перерасчет всех уголков.
32 IE не дает выставить новое значение свойства arcSize,
33 поэтому убиваем ноду и создаем заново.
35 window
.attachEvent
("onresize", function
(){
36 obj
.runtimeStyle
.backgroundColor
= round
.fillColor
; /* BUGFIX: Лечим в IE6 маргание при пересоздании ноды */
37 var _round
= obj
.removeChild
(round
);
38 _round
.arcSize
= obj
.offsetWidth
< obj
.offsetHeight ? parseInt
(obj
.currentStyle
.IEBorderRadius
) / obj
.offsetWidth : parseInt
(obj
.currentStyle
.IEBorderRadius
) / obj
.offsetHeight
;
39 obj
.appendChild
(_round
);
40 obj
.runtimeStyle
.backgroundColor
= "transparent"; /* Убиваем фон, чтобы не перекрывал уголки. */
49 .b-round v\:roundrect {
53 height: expression
(parentNode
.offsetHeight-1
+ 'px');
57 v\
:* { behavior:url
(#default#VML
);display:inline-block
}
59 /* Rounded block (end) */