A bidirectional scale in Firefox extension
I am writing a firefox extension where I need a bidirectional scale element (https://developer.mozilla.org/en/XUL/scale)
While the sample code of this xul element talks about a scale in one direction, how ca开发者_运维知识库n I make a scale which can have a slider bar at the two directions so that I can take a range as the input?
Thanks, Kapil
One of the cool things about XUL is that you can create new XUL elements using XBL bindings which is very easy to do.* The official tutorial from Mozilla is https://developer.mozilla.org/en/XUL_Tutorial/Introduction_to_XBL and http://mb.eschew.org/15 appears to be another good one.
Since your new element will be relatively similar to the built-in XUL <scale>
element, you might want to start by looking at its XBL bindings. Just point your Firefox browser at chrome://global/content/bindings/scale.xml
and then maybe you can extend/modify it to get what you need.
* At least, it looks easy. I haven't actually done it.
精彩评论