views:

81

answers:

1

Which JavaScript solution (Not .htc) can really make Anti aliased round corner in IE7 and 8 like CSS3 gives in supported browsers?

I tried many

http://www.ruzee.com/blog/ruzeeborders/

http://blue-anvil.com/archives/anti-aliased-rounded-corners-with-jquery/

http://www.curvycorners.net/

All are claiming to give anti aliased corner but giving corners like this

alt text

But no one is giving anti aliased corner. if I need 10px round corner.

+1  A: 

You can certainly make flexible elements with image round corners.

See this article.

Because CSS3 border-radius is now supported in many of the modern browsers, you could use that as your primary solution and provide a fallback for the ones that don't support it.

On a recent project, I created the website with border-radius and used the jQuery .wrap() for browsers that didn't support it. It looks something like this:

HTML

<div class="round">
    <p>Hi, I'm a paragraph</p>
</div>

CSS

.round {
    border: 1px solid red;
    -moz-border-radius: 10px;
    -webkit-border-radius: 10px;
}

jQuery

if ($.browser.msie) {
    $('.round').wrap('<div class="tl"><div class="tr"><div class="bl"><div class="br"></div></div></div></div>');
}

And you can then style the round corner elements as per the article above.

Marko
I tried this method but it's not working http://jsbin.com/oweka3/9
metal-gear-solid
Have you styled the round corners? You still need to use images for IE. You've applied everything correctly, you just need to style the round corners now (and remove the 1px red border programatically for IE because it will get replaced by the image round corners)
Marko
just for example i styled round corner with background color and height temporarily. and it should work, positioning is not related to images.
metal-gear-solid
I see what you mean - I've added a <div class="content"></div> where the content gets injected. Previously the content was being added to one of the round corners. Also there is now a relatively positioned parent. check it out here http://jsfiddle.net/9AyJy/4/
Marko
ok. we can also do in this way http://jsbin.com/oweka3/16and i need border because i'm making round corner with `1px` border
metal-gear-solid
Yeah - but you probably want to make the border part of the rounded corner images and disable the CSS border in jQuery (as per my jsFiddle).
Marko
metal-gear-solid
Yep you can append it too - that will work as well! Looking good - now just replace them with images :)
Marko