|
|
| ||||
Other Projects | JQuery MicropluginsA set of UI widgets that just provide the core functionality and use event delegation for maximum flexibility. Accordion, Tabs, Toolbar and Treeview, with hopefully more to follow. I built these for a web application that I'm hoping to release in the near future. It's quite a big project, with all the above widgets (and a few more besides), so I wanted the code and markup to be as small as possible and still be able to turn them into plugins. I also wanted to be able to add extra elements if required without having to rebind events to the added elements, so I used event delegation. Basically, the container element takes the event, and the plugin then checks which element was the target and implements the events accordingly. They also provide an optional "click" callback to handle cases where extra functionality is required. this uses two arguments, the event and the jquerified target. The iframe below shows some examples including the markup used. Tabs don't initialise properly until they are clicked, but that's only because they are in an iframe. Options are kept to a minimum. Accordion and Tabs can take an init parameter, which is 0 based, that sets which tab or dt is opened initially. Tabs also take an extra parameter "panel", which is the class name used for the content divs. All plugins take a "click" callback, which is where any extra functionality should be put. The mplugins.htm page shows some examples of this. They also seem to work best across all browsers with <!doctype html> doctype, which I think is strict. Source code and image files can be downloaded here. If you keep the directory structure as it is in the zip, it should work straight out of the box. | JQuery/PHP Website and Applications Developer, based in Ireland. Help me build a supercomputer | |||
| Page Layout and Program Design by Paul Hanlon Page visited 3418 times. | |||||
0 Comments
Post New Comment