EZPA55 (1) [Avatar] Offline
#1
Can someone please tell me how to add the ability to specify any styles to the states read/write. Thanks still very much an amateur here.
KAES (14) [Avatar] Offline
#2
Re: 7.4 Extra Credit - Modify the method to accept any styles
Someone please feel free to chime in.

Would the correct way to do this be to create a JS object to map the .css() api or to use the $.extend() outlined in 7.2.3 ?
KAES (14) [Avatar] Offline
#3
Re: 7.4 Extra Credit - Modify the method to accept any styles
(function($){
$.fn.setReadOnly = function(readonly) {
var cssObj ={ /*added*/
'opacity': readonly ? 0.5 : 1.0,
'background-color': readonly ? 'red' : 'white'
}
return this.filter('input:text')
.attr('readOnly',readonly)
.css(cssObj)
.end();
};
})(jQuery);