Thanks Walter, I have noticed some varied usage of 'quoted' and
unquoted, and some reports that some 'names' must be quoted and others
work fine unquoted... in particular 'float' must be quoted to work at
all..

Seems like odd behaviour to me....

Thanks Colin, I think its time for me to organise sime spectacles. It
was a loing week at the Laptop screen...

Yes, I wanted to use a shortcut method to get IE writing to the
<style> tag..
Unfortunatly the code for IE does not work for Firefox..

>From --> www.rule52.com/

var CSSRules = function() {

 var headElement = document.getElementsByTagName("head")[0],
  styleElement = document.createElement("style");
 styleElement.type = "text/css";
 headElement.appendChild(styleElement);

 // memoize the browser-dependent add function
 var add = function() {
  // IE doesn't allow you to append text nodes to <style> elements
  if (styleElement.styleSheet) {
   return function(selector, rule) { // IE Method
     if (styleElement.styleSheet.cssText == '') {
       styleElement.styleSheet.cssText = '';
     }
     styleElement.styleSheet.cssText += selector + " { " + rule +
" }";
   }
  } else {
   return function(selector, rule) { // Firefox and Co..
    styleElement.appendChild(document.createTextNode(selector + " { "
+ rule + " }"));
   }
  }
 }();

 return {
  add : add
 }

A long way for a short job!!

I might try messing with the $$(CSS) method when the weekend comes
along and see if I can get something happening..

Thanks for the responses..

Regards,
             Gilbert R

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

On Jun 3, 12:07 am, ColinFine <colin.f...@pace.com> wrote:
> On Jun 2, 1:37 pm, IMBI-Indie-Portal <imbil...@tpg.com.au> wrote:> Thanks 
> Colin, but, there is a space, if you check the source code
> > page, It didn't fit to well into the post.
> > As you can see, it works as a HTMLDOM style, almost the same code..
> > border: this.olc_divborder+'px' +this.olc_bordercol+ 'solid'
> > there is one space on each side.
>
> There is not. There is a space *outside* the quotes, but not one that
> will go into the string which you are generating. This will pass an
> object like
>
> { border: '222pxblacksolid' }
>
> > The way I read it from the DOCS is that if it works as a HTMLDOM
> > shorthand method, it should work in setStyle(); ???
>
> Yes. But the shorthand property  has a different name from the
> individual property. You appeared to be trying to say
> { backgroundImage: 'url(xxx) top left' }
> instead of
> { background: 'url(xxx) top left' }
> or
> { backgroundImage: 'url(xxx)',
>   backgroundPosition: 'top left' }
>
> I don't know about the appendChild 
> problem.http://www.phpied.com/dynamic-script-and-style-elements-in-ie/gives a
> solution, but I think you know this and are asking about whether
> Prototype helps with it or not, and I don't know the answer.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to