Re: CSS Selectors: How to style non-styleable?

Le Fri, 10 Mar 2006 23:28:21 +0200, Boris Zbarsky <bzbarsky@mit.edu> a  
écrit:

> Mihai Sucan wrote:
>> 1. Provide DOM elements for scrollbars and for all "hidden" elements.
>>  document.getElementById('scrollable-element').scrollbar:
>
> What happens if I appendChild this element somewhere else in my  
> document?  Does the scrollbar break?

No, because element.scrollbar is not a DOMNode. It's just a DOM object.

Think of it like having something from JS:

document.getElementById("scrollable-element").scrollbar = {
 top: function () { [code] },
 bottom: function () { [code] },
 ...
}

Same goes for scollbar.upElement/downElement/etc.

> What if I change its style to display:none?

This is not an element you can reference via CSS.

> What if I set random attributes on it?

scrollbar.setAttribute() is not available, and setting  
.scrollbar.whatever.random has no effect, just like setting  
document.something.random has no effect. Yet .scrollbar could be made  
read-only.


-- 
http://www.robodesign.ro
ROBO Design - We bring you the future

Received on Saturday, 11 March 2006 10:34:46 UTC