Posts

How to create a rounded corner box plugin with jQuery

Recently, we have redesigned one of our projects. The task was to make the web application to look and act more like Web2.0 app. New design looked great and surely it had lot's of rounded corners. You can download jQuery Rounded Corners plugin. First, rounded corners were done using CSS, but it got our code cluttered and it introduced a lot of unnecessary HTML markup. Since we had full control

How to create a rounded corner box plugin with jQuery

Recently, we have redesigned one of our projects. The task was to make the web application to look and act more like Web2.0 app. New design looked great and surely it had lot's of rounded corners. You can download jQuery Rounded Corners plugin. First, rounded corners were done using CSS, but it got our code cluttered and it introduced a lot of unnecessary HTML markup. Since we had full control

How to set default settings in your jQuery plugins

Recently we had a post about automatically adding row count to your tables and then made a plugin out of it. We could further improve our plug-in by providing an option to let plug-in users to overwrite default setting. For example plugin users could provide a CSS class to set to the added column or change the default "#" in the column header to some other meaningful text. This is all possible

How to set default settings in your jQuery plugins

Recently we had a post about automatically adding row count to your tables and then made a plugin out of it. We could further improve our plug-in by providing an option to let plug-in users to overwrite default setting. For example plugin users could provide a CSS class to set to the added column or change the default "#" in the column header to some other meaningful text. This is all possible

Namespace your JavaScript function and variable with jQuery

We all know that global variable are evil. Namespacing  your variables and methods is now considered a good practice and shows your awareness about the trends. Anyway, I thought how can I namespace my variables and methods in jQuery. Well, first off, I can easily extend jQuery with custom written plugins. $.fn.extend({ myNamespaced: function(myArg){ return 'namespaced.' + myArg; } });

Namespace your JavaScript function and variable with jQuery

We all know that global variable are evil. Namespacing  your variables and methods is now considered a good practice and shows your awareness about the trends. Anyway, I thought how can I namespace my variables and methods in jQuery. Well, first off, I can easily extend jQuery with custom written plugins. $.fn.extend({ myNamespaced: function(myArg){ return 'namespaced.' + myArg; } });

Dynamically adding table row count number using JavaScript and jQuery

Now available as a rowCount jQuery plugin. Recently on jQuery mailing list a user asked how he/she could add a row count in their table automatically. So I wrote a code snippet which looks like this: $(document).ready(function(){ $("table").each(function(){ if($(this).is('table')){ $('thead th:first-child, thead td:first-child', this).each(function(){ if($(this).is('td'))