Archive

Archive for the ‘CSS’ Category

Dev Watch – jNiceIt

jNiceIt – jQuery plugin to customize design of textboxes, radiobuttons, checkboxes, and more! (ajaxBlender.com)

jNiceIt is a jQuery plugin which allows you to customize generic form controls and apply your customized design to them. You may use this plugin to emulate MS Windows, Linux or Apple MacOS controls or your own unique style.
Design of each control can be fully customized via CSS. The plugin supports both fixed and fluid page layouts because it does not use absolute positioning of skinned controls like most jNiceIt alternatives do.

Reference URLs:

Categories: CSS Tags: ,

Add CSS to a page dynamically

February 26, 2009 Leave a comment

 Sometime, we need to add some CSS to a page dynamically.

We can use the following javascript to  add a CSS to a page. This is helful when we are adding/modifying a page in some portal applications like Joomla or Share-point. where we cannot add the CSS to a page in design time.

 

function AddCSS(skinPath)
{
        if(document.createStyleSheet)
       {
            document.createStyleSheet(skinPath);
       }
       else
       
{
              var styles = “@import url(‘ “+skinPath+” ‘);”;
              var newSS=document.createElement(‘link’);
              newSS.rel=‘stylesheet’;
              newSS.href=‘data:text/css,’+escape(styles);
              document.getElementsByTagName(“head”)[0].appendChild(newSS);
       }
}

Categories: CSS Tags: ,