Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 34689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T14:07:05+00:00 2026-05-10T14:07:05+00:00

I wanted some of those spiffy rounded corners for a web project that I’m

  • 0

I wanted some of those spiffy rounded corners for a web project that I’m currently working on.

I thought I’d try to accomplish it using javascript and not CSS in an effort to keep the requests for image files to a minimum (yes, I know that it’s possible to combine all required rounded corner shapes into one image) and I also wanted to be able to change the background color pretty much on the fly.

I already utilize jQuery so I looked at the excellent rounded corners plugin and it worked like a charm in every browser I tried. Being a developer however I noticed the opportunity to make it a bit more efficient. The script already includes code for detecting if the current browser supports webkit rounded corners (safari based browsers). If so it uses raw CSS instead of creating layers of divs.

I thought that it would be awesome if the same kind of check could be performed to see if the browser supports the Gecko-specific -moz-border-radius-* properties and if so utilize them.

The check for webkit support looks like this:

var webkitAvailable = false;   try {       webkitAvailable = (document.defaultView.getComputedStyle(this[0], null)['-webkit-border-radius'] != undefined); }  catch(err) {} 

That, however, did not work for -moz-border-radius so I started checking for alternatives.

My fallback solution is of course to use browser detection but that’s far from recommended practice ofcourse.

My best solution yet is as follows.

var mozborderAvailable = false; try {     var o = jQuery('<div>').css('-moz-border-radius', '1px');     mozborderAvailable = $(o).css('-moz-border-radius-topleft') == '1px';     o = null; } catch(err) {} 

It’s based on the theory that Gecko ‘expands’ the composite -moz-border-radius to the four sub-properties

  • -moz-border-radius-topleft
  • -moz-border-radius-topright
  • -moz-border-radius-bottomleft
  • -moz-border-radius-bottomright

Is there any javascript/CSS guru out there that have a better solution?

(The feature request for this page is at http://plugins.jquery.com/node/3619)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T14:07:05+00:00Added an answer on May 10, 2026 at 2:07 pm

    How about this?

    var mozborderAvailable = false; try {   if (typeof(document.body.style.MozBorderRadius) !== 'undefined') {     mozborderAvailable = true;   } } catch(err) {} 

    I tested it in Firefox 3 (true) and false in: Safari, IE7, and Opera.

    (Edit: better undefined test)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wanted to make some simple file recovery software, where I want to try
I wanted to create some subdirectories inside my blob. But it is not working
I'm using pyDes to encrypt some data. I wanted to demonstrate that if you
I wanted to generate some XML Schemas for my project. I have some Java
Wanted to get some consensus around a UI feature I'm working on right now.
Some Quick Background I'm building an iOS app that uses html web views in
I wanted some system where I didn't have to keep looking at the Exception
I would like to learn ASP.NET and just wanted some input as to which
I know the topic I started is too subjective. But I just wanted some
This is going to be a quick discussion, but I just wanted some feedback

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.