Ask questions and get good answers on jQuery

Hi, do you have any suggestions on how to round the corner of menus in Internet Explorer using your menu system? Thanks.

asked Nov 18 '09 at 18:29

Mik's gravatar image

Mik
313


currently the best pratice would be to use an .htc script like css3pie, beacuse it's fairly simple to use. You can also try the jquery rounded cornes plugin.

answered Aug 15 '10 at 11:24

Klobi's gravatar image

Klobi
16

Actually there's no simple way to round corners in IE via css; you can try using one of the many javascripts but most of them adds a huge amount of DIVs to do that and it's quite heavy for performances...

answered Dec 16 '09 at 22:09

Matteo%20Bicocchi's gravatar image

Matteo Bicocchi ♦♦
1776129

I found this that may be of interest:

http://code.google.com/p/jqcanvas/

answered Feb 10 '10 at 11:19

Mat's gravatar image

Mat
5517

use jpeg rounded images in a table that is most sophisticated way to get the rounded corner rather to use any JavaScript or CSS methods.

answered Feb 13 '10 at 18:07

nasir's gravatar image

nasir
211

Use CSS and background images. This would prevent the need to go back in time to 1999 and use tables...

Taken (almost) verbatum from a menu on one of my sites

HTML:

<div id="nav">
            <ul>
                <li class="active"><a class="tab active" href="/"><span class="l"></span><span class="t">Home Page</span><span class="r"></span></a></li>
                <li><a class="tab" href="/"><span class="l"></span><span class="t">A Page</span><span class="r"></span></a></li>
                <li><a class="tab" href="/"><span class="l"></span><span class="t">A Page</span><span class="r"></span></a></li>
                <li><a class="tab" href="/"><span class="l"></span><span class="t">A Page</span><span class="r"></span></a></li>
            </ul>

        </div>

CSS:

#nav{background:url(bg/nav-bg.png) bottom left repeat-x;overflow:hidden;font-family:"Times New Roman", Times, serif;font-size:1.2em;}
#nav li{display:block;float:left;height:40px;text-align:center;margin:0 2px;font-weight:700;color:#fff;text-shadow: rgba(0,0,0,0.5) -1px 0, rgba(0,0,0,0.3) 0 -1px, rgba(255,255,255,0.5) 0 1px, rgba(0,0,0,0.3) -1px -1px;}
#nav li.active,#nav li:hover{color:#373535;cursor:hand;cursor:pointer;text-shadow:none;}
#nav a{color:#fff;line-height:36px;}
#nav span.l{background:transparent url(bg/tab-bg.png) top left no-repeat;width:18px;float:left;height:40px;}
#nav span.r{background:transparent url(bg/tab-bg.png) top right no-repeat;width:18px;float:right;height:40px;}
#nav span.t{background:transparent url(bg/tab-bg.png) top center no-repeat;float:left;height:40px;}
#nav a.active, #nav a:hover,#nav li.active a,#nav li:hover a,
#nav a.active span.l, #nav a:hover span.l,#nav li.active span.l,#nav li:hover span.l{background-position:bottom left;color:#373535;}
#nav a.active, #nav a:hover,#nav li.active a,#nav li:hover a,
#nav a.active span.r, #nav a:hover span.r,#nav li.active span.r,#nav li:hover span.r{background-position:bottom right;color:#373535;}
#nav a.active, #nav a:hover,#nav li.active a,#nav li:hover a,
#nav a.active span.t, #nav a:hover span.t,#nav li.active span.t,#nav li:hover span.t{background-position:bottom center;color:#373535;}

I don't have enough Karma to upload the images, so Ive uploaded them to my blog so you can see how I did it:

Menu BG image (just 1px wide) alt text

Main tab image (with 'sliding doors' roll over) alt text

The way this is done, I can have a 3D style with any text I like in the tab and the container expands to suit without wrecking the look. Works for me!

answered Apr 08 '11 at 13:21

myshadowself's gravatar image

myshadowself
11

Your answer
toggle preview

jQuery main site - Matteo Bicocchi