For IE only, you can use Microsoft's proprietary "expression" extension to execute JavaScript from the stylesheet, e.g.:

        div#header
        {
           width: expression("window.clientWidth / 2");
        }

Use of expression() is currently* an IE-only filter, e.g.:

        div#blob
        {
           width: 100px;               /* all browsers */
           width: expression("98px");  /* IE only */
        }

* If other browsers incorporate expression() in the future, this hack will obviously fail to pinpoint IE.

Paul


At 03:50 PM 8/24/2005, Patrick H. Lauke wrote:
Nick Gleitzman wrote:
On 24 Aug 2005, at 6:47 PM, Bennie, Jack wrote:

Does anyone know any neat code [JScript/CSS - not PHP] that can randomly load a selection of images into the 'background-image' selector?

Which makes me wonder - will a browser call and execute javascript if it's contained within, or linked from, a CSS file?

I certainly hope not, as CSS can't contain JS, and there is no mechanism in CSS to link to a JS file.
The javascript would need to be called from the (X)HTML, of course...

--
Patrick H. Lauke
__________________________________________________________
re·dux (adj.): brought back; returned. used postpositively
[latin : re-, re- + dux, leader; see duke.]
www.splintered.co.uk | www.photographia.co.uk
http://redux.deviantart.com
__________________________________________________________
Web Standards Project (WaSP) Accessibility Task Force
http://webstandards.org/
__________________________________________________________
******************************************************
The discussion list for  http://webstandardsgroup.org/

See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************



******************************************************
The discussion list for  http://webstandardsgroup.org/

See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************

Reply via email to