Wednesday, September 28, 2011

HTML Blinking Text in IE

The html <BLINK> tag does not work in IE browsers. In case if it's a requirement that we need to make it work in IE browsers then jquery would be the best solution for it.

Download source file here


Wednesday, September 21, 2011

jquery Rounded corners in IE7 and IE8; no images

It's been a very long time since I was looking for foolproof rounded corner solution for IE7 and IE8. curvycorners.src.js comes to rescue. What is does is pretty simple. It checks for '-moz-border-radius: 10px;' in the given CSS class and applies the same rounded corners in IE browsers.

No images. No hacks. Only one compressed js file.

Download source file here

Here is all in one CSS3 rounded corners and many other properties solution for IE7 and IE8. This is also nominated for 'Innovation of the year' in .net magazine awards 2011.
CSS3 PIE (Progressive Internet Explorer): http://css3pie.com/documentation/getting-started/

CSS3 PIE - Supported CSS3 Features: http://css3pie.com/documentation/supported-css3-features/



Tuesday, September 20, 2011

Detecting browser versions and Operating Systems with jquery

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script type="text/javascript" src="jquery.client.js"></script>
Download clients.js here

<script type="text/javascript">
$(function() {

//Firefox 3.6
var version=jQuery.browser.version;
if (jQuery.browser.mozilla) {   
    var verarray=version.split('.');
    if(verarray[0]=='1' && verarray[1]=='9')
    {
        /*var head= document.getElementsByTagName('head')[0];
        var addCSS= document.createElement('link');
        addCSS.href = 'css/CSIdentity.ff3.5.css';
        addCSS.rel = 'stylesheet';
        addCSS.type = 'text/css';
        head.appendChild(addCSS);*/
        $(".nav li:first-child").css({"padding":"10px"})
    }   
}   
//Mac Safari 5
var dos = $.client.os;
var dbv = $.client.browser=="Safari";
if(dos == "Mac" && dbv && (navigator.appVersion.indexOf('5.') != -1)){
    $(".nav li:first-child").css({"padding":"20px"})
}
//Mac Chrome
var dbvch = $.client.browser=="Chrome";
if(dos == "Mac" && dbvch){
    $(".nav li:first-child").css({"padding":"24px"})
}
//Mac Firefox 3.6
if(dos == "Mac" && jQuery.browser.mozilla){
    var verarray=version.split('.');
    if(verarray[0]=='1' && verarray[1]=='9')
    {       
        $(".nav li:first-child").css({"padding":"26px"});
    }   
}
//FF 4.0
if(dos == "Mac" && jQuery.browser.mozilla && version == "2.0"){
    $(".nav li:first-child").css({"padding":"28px"});       
}
//FF 5.0
if(dos == "Mac" && jQuery.browser.mozilla && version == "5.0.1"){
    $(".nav li:first-child").css({"padding":"30px"});
}

//Windows Vista FF
if(navigator.oscpu == "Windows NT 6.0" && jQuery.browser.mozilla && version == "2.0"){ 
    $(".nav li:first-child").css({"padding":"32px"});
}
if(navigator.oscpu == "Windows NT 6.0" && jQuery.browser.mozilla && version == "5.0.1"){ 
    $(".nav li:first-child").css({"padding":"8px"});   
}
if(navigator.oscpu == "Windows NT 6.0" && jQuery.browser.mozilla && version == "6.0.2"){ 
    $(".nav li:first-child").css({"padding":"6px"});   
}