Because I posted this topic twice by mistake, it seems this is a
confusing thread.  I replied to the other, but no one answered-- and
people are replying to this one, so I am going to repost my last reply
from the other thread.

>Patrick double posted and i replied to the
>second post - perhaps thats in a different group ?

Sorry about that--  I clicked on my post to view it after I submitted
it, and I got a message saying my post had been removed-- so I posted
it a 2nd time, and then the 1st one was there after all.. So I deleted
it..

Anyway, after many hours of trying to figure this thing out, I finally
figured out what the deal is.  Apparently, for whatever reason, there
are many css attributes that are simply not accessible by getStyle.

I will prove this with the firebug console.

In my html document, I have:

<p id="test">hello</p>
<p id="test2">hello again</p>

... in my external css file, I have:

#test {
  padding: 25px;

}

#test2 {
  padding: 25px;
  display: inline;

}

In firebug:

>>> $('test')
<p id="test">
>>> $('test2')

<p id="test2">

.. ok, so both test and test2 are there..

>>> $('test').getStyle('padding')

""

>>> $('test2').getStyle('display')

"inline"

...  so it can read the display, but not padding (for whatever
reason).

>>> $('test2').getStyle('padding')
""
>>> new Effect.Morph($('test2'), {style: {'padding': '100px'}});

Object element=p#test2 style=Object options=Object
>>> $('test2').getStyle('padding')

"100px 100px 100px 100px"

...  And that is why I would have to initiate the morph call several
times before the changes would actually take effect.  So I found that
if I put in my dom:loaded observer setStyle{'padding': '50px'} -- then
it works because it can see the padding.  But I do not understand why
it can't see it to begin with... sooo frustrating and I wasted so many
hours on something that seems so dumb.

...  And then there are other attributes that morph just will not
change at all, no matter what...

>>> $('test2').getStyle('display')
"inline"
>>> new Effect.Morph(('test2'), {style: {'display': 'block'}});

Object element=p#test2 style=Object options=Object
>>> $('test2').getStyle('display')

"inline"

... ?!??!?!?!

So.. I have to manually do setStyle to change the display evidently.
nonsense!!!!

-patrick
--~--~---------~--~----~------------~-------~--~----~
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