I had already posted about "What's new in jQuery 1.6" and "jQuery.holdReady() New in jQuery 1.6".With jQuery 1.6, you can take advantage of Relative CSS. When I say relative, that means that you can update existing CSS value using relative values. For example, the width of the div element is 500px and you want to update it to 600. Then with 1.6, you can simply say "+=100px".
Feel free to contact me for any help related to jQuery, I will gladly help you.
$(document).ready(function() { $('#dvExample').css('width','350px'); $('#btnWidth').click(function() { $('#dvExample').css('width','+=100px'); }); });Initially, the width of the div is set to 350px and on click of button, its width is increased by 100px.You need to use "+=" and "-=" as prefix to update the existing value with the relative values. With every click on the button, it will increase the width by 100px.
Feel free to contact me for any help related to jQuery, I will gladly help you.
No comments:
Post a Comment