Hi all - I've extended Prototype.BrowserFeatures and thought I'd check  
with those in the know whether this makes sense as an approach or how  
it could be improved. Basically I want to test to see if the browser  
supports setting border-radius with CSS so that I can only use  
javascript methods for browsers that need it. alphaPNG is to test  
whether or not I need to use any hacks to make transparency work for  
IE6. I don't know of any way to actually test that feature so I just  
basically sniffed for 'less than IE7'.

Object.extend(Prototype.BrowserFeatures,{
        borderRadius: (
                function(){
                        var radiusTest = $(document).createElement('div');
                        try {
                                return !!(
                                        
radiusTest.getStyle('-webkit-border-radius') !== undefined ||
                                        
radiusTest.getStyle('-moz-border-radius') !== undefined ||
                                        radiusTest.getStyle('border-radius') 
!== undefined
                                );
                        }                       
                        catch(x) {
                                return false;
                        }
                }()
        ),      
        alphaPNG: !(Prototype.Browser.IE && !window.XMLHttpRequest)
});

Thanks for your input, Tim

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to