user1576534
user1576534

Reputation: 7

Best way to make your own custom UI widget complete with js,css and html reusable?

I have a complex html element that has some css and associated js with it. It is a combination of a html5 slider, multiple labels and text box. The problem is that it is likely to be used up at a lot of places. Re-writing the html, css, js is not the best way to make it re-usable. Here are my requirements

Any help will be highly appreciated!

Upvotes: 1

Views: 1080

Answers (1)

robertc
robertc

Reputation: 75707

The W3C standard for this sort of thing will likely be Web Components, though the spec is not finalized and so far only Chrome has an implementation (relevant Firefox request). There was a talk on Web Components and Shadow DOM (video) at the recent Google I/O. The X-Tag custom elements polylib will allow you to start experimenting with Web Components now.

If you need to support versions of IE prior to 9 you're stuck with building things in a similar way to the Dojo and jQuery UI widgets you mention.

Upvotes: 1

Related Questions