in partnership with mediatemple

Ticket #577 (assigned enhancement)

Opened 7 months ago

Last modified 2 days ago

Create a new style element with innerCSS error.

Reported by: DanielSteigerwald Owned by: kamicane
Type: enhancement Priority: minor
Milestone: Mootools version 1.3 Component: Core
Keywords: Cc:

Description

I wanted this:

var style = [
                '  *            { margin: 0; padding: 0; }',
                '  body, html   { width: 100%; height: 100%; overflow: hidden; font-size: 100%; font-family: \'Trebuchet MS\', \'Geneva CE\', lucida, sans-serif;}'
            ].join('');        
            
            var el = new Element('style', { 
                'type': 'text/css',
                'text': style
            }).inject(document.head); 


But IE6/7 throws a some exceptions.
This works:

var el = document.createElement('style');
            el.setAttribute('type','text/css');
            Browser.Engine.trident ? el.styleSheet.cssText = style : el.appendText(style);
            document.head.appendChild(el);

Change History

Changed 6 months ago by kamicane

  • owner set to kamicane
  • status changed from new to assigned

Changed 6 months ago by kamicane

  • type changed from defect to enhancement
  • milestone changed from Mootools version 1.2 to Mootools version 1.3

This should be considered enhancement.

We will add support for stylesheets when we add a full Style class.

Changed 2 days ago by tomocchino

  • priority changed from trivial to minor
  • milestone set to Mootools version 1.3
Note: See TracTickets for help on using tickets.