Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Special css class names for developers
#1
How about having special class names that can be used by developers for extra functionality (JavaScript interactivity wise)?

For example have an input
Code:
<input name="event_date" class="date" />
and when you click on it a date picker shows? Or <textarea class='rte'></textarea> and you get a rich text editor.

Then with jQuery in document.ready (assuming jQuery UI datepicker and the CKEditor jQuery Adapter are loaded, but can check just in case they are not).

Code:
if($.fn.datepicker) $("input.date").datepicker();
if($.fn.ckeditor) $("textarea.rte").ckeditor();

Could also be used for styling purposes as well, i.e. with class 'date' or 'time' the input would be narrower, or class 'widetext' would be full width.
-- Sam
Reply


Messages In This Thread
Special css class names for developers - by SamWM - 2010-07-13, 20:02:27
Special css class names for developers - by SamWM - 2010-07-16, 20:29:30



Users browsing this thread: 1 Guest(s)