-
-
Save subtleGradient/764252 to your computer and use it in GitHub Desktop.
<form> | |
<input type="datetime" data-behavior="TimePicker" data-timepicker-pad="true" data-timepicker-labels-hours="HR" /> | |
</form> | |
<a href="#my_modal" data-behavior="TargetModal">Open Modal</a> | |
<div id="my_modal" data-behavior="Modal" data-modal-style="color:#333; opacity:0.7"> | |
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. | |
</div> |
Fair comments all.
No experience with the native datepicker but I am not a fan of implementing multiple UI elements based on modernizer. The control works in a wide selection of browsers already, so my personal preference is to stick with it. :)
This is a bad example of the modal code ( in most cases the modal's content would be pulled with XHR) - I just wanted to give the data attribute markup in my example. The css-like properties are used in Morph animations and by subclassed elements, but in an ideal world... :)
http://sixtyseconds.github.com/mootools-date-picker/
http://sixtyseconds.github.com/mootools-modal/
Thanks for your comments - I will consider them at length.
"For opening up a modal from a link, I would create the modal separately, with its content, and then hook the link up to simple show and hide that thing.
That way all the options for the modal are declared at the modal itself."
Sorry to bump in, but i'd say (too) that the modal (content) can rely alot on the link itself where you'd use a data-modal='{"url":"/page/detail/1"}' attribute or something. I would just put an empty modal template in the page or something (or create default one on the fly if options.template is empty)
That's similar to what I had in mind for modal in my example...
Agreed, that's another good way to do it. I'd use data-modal='{foo:"bar"}'
to set modal-specific options on something that isn't a Modal element.
For opening up a modal from a link, I would create the modal separately, with its content, and then hook the link up to simple show and hide that thing.
That way all the options for the modal are declared at the modal itself.
Also, use CSS-like syntax instead of multiple properties when declaring visual things like color and opacity.