I'm not sure that function works correctly with span elements, have you tried using it on a div?

Colin

sliver wrote:
noticed a couple typos in the old snippets i pasted... i put working
code in a pastie here:
http://pastie.caboo.se/52199


On Apr 6, 9:31 am, "sliver" <[EMAIL PROTECTED]> wrote:
  
As an update... i added a lil bit of code to check the inner elements
dimensoins using:

$('debug').immediateDescendants().each( function(el) {
        var dimE = el.getDimensions();
        $('debugLog').update($('debugLog').innerHTML + '<br>height: ' +
dimE.height + ' width: ' + dimE.width);

});

and it accurately returns the size of those elements... is it
something do to with css?

On Apr 6, 8:57 am, "sliver" <[EMAIL PROTECTED]> wrote:

    
Ive posted this before, but unfortunately I still have yet to resolve
it after numerous attempts...
      
Here is the overview: populate a container element with some new html
using Element.update and then retrieve the new dimensions of the
containig element.
      
Here is a bit of code snippet that I would think should work.. but
doesn't:
      
==== start snippet ====
<style>
.bigBox {
        height: 100px;
        width: 200px;
      
}
      
</style>
      
<script>
var content = '<span class="bigbox">hello world</span>';
$('debug').update(content);
var dim = $('debug').getDimensions();
$('debugLog').update('height: ' + dim.height + ' width: ' +
dim.width);
</script>
</head>
<body>
<span id="debugLog"></span>
<span id="debug"></span>
      
==== end snippet ====
      
The results returned are consistently:
      
mac firefox: height: 14 width: 0
mac safari: height: 17 width: 0
      
Ive tried setting a timeout by suggestion, which had no effect...
anyone have any ideas?
      




  

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to