Hi there, code speaks for itself: SameHeight = function(selector) { var els,offH,maxH els = $$(selector); // collect heights offH = els.pluck(''offsetHeight''); //find max height maxH = offH.max(); // apply a filler to make the selected elements equal in height els.each( function(el,idx){ var gap = maxH - offH[idx]; if(gap > 0) { var F = Builder.node(''b'',{className:''gapfill''}); //F.setStyle({''height'':gap+''px'',''display'':''block''}); // ERROR IN IE7 Element.setStyle(F,{''height'':gap+''px'',''display'':''block''}); //THIS WORKS el.appendChild(F); } }); }; An error happens using IE7 either with SAU 1.7.0 or 1.7.1b1 & included prototype. What''s wrong with this? (except that browser beast ;) Alessandro --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
IE doesn''t extend HTML Elements by default. You might need to do this: var F = Element.extend(Builder.node(''b'',{className:''gapfill''})); The nice part about the extend() method is that if the element is already extended (as it would be for non-IE browsers) then nothing actually ends up happening. Not sure if this is your problem, but it''s a good thing to check when you run into things that work elsewhere but not in IE. - Dash - Alessandro Curci wrote:> Hi there, > > code speaks for itself: > > SameHeight = function(selector) { > > var els,offH,maxH > els = $$(selector); > > // collect heights > offH = els.pluck(''offsetHeight''); > > //find max height > maxH = offH.max(); > > // apply a filler to make the selected elements equal in height > els.each( function(el,idx){ > var gap = maxH - offH[idx]; > if(gap > 0) { > var F = Builder.node(''b'',{className:''gapfill''}); > > //F.setStyle({''height'':gap+''px'',''display'':''block''}); // > ERROR IN IE7 > Element.setStyle(F,{''height'':gap+''px'',''display'':''block''}); > //THIS WORKS > > el.appendChild(F); > } > }); > }; > > An error happens using IE7 either with SAU 1.7.0 or 1.7.1b1 & included > prototype. > > What''s wrong with this? (except that browser beast ;) > > Alessandro > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Nice, isn''t it? prototype helps to fill browser gaps! Thanks to everyone involved in making this happen. --htrex; David Dashifen Kees ha scritto:> IE doesn''t extend HTML Elements by default. You might need to do this: > > var F = Element.extend(Builder.node(''b'',{className:''gapfill''})); > > The nice part about the extend() method is that if the element is > already extended (as it would be for non-IE browsers) then nothing > actually ends up happening. Not sure if this is your problem, but it''s > a good thing to check when you run into things that work elsewhere but > not in IE. > > - Dash - > > Alessandro Curci wrote: >[...] --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> </head> <body bgcolor="#ffffff" text="#000000"> I still don''t know why Builder.node doesn''t just extend the new node before returning it..<br> <br> <br> David Dashifen Kees wrote: <blockquote cite="mid:4602B661.3090003-NT0ononE2K1Wk0Htik3J/w@public.gmane.org" type="cite"> <pre wrap="">IE doesn''t extend HTML Elements by default. You might need to do this: var F = Element.extend(Builder.node(''b'',{className:''gapfill''})); The nice part about the extend() method is that if the element is already extended (as it would be for non-IE browsers) then nothing actually ends up happening. Not sure if this is your problem, but it''s a good thing to check when you run into things that work elsewhere but not in IE. - Dash - Alessandro Curci wrote: </pre> <blockquote type="cite"> <pre wrap="">Hi there, code speaks for itself: SameHeight = function(selector) { var els,offH,maxH els = $$(selector); // collect heights offH = els.pluck(''offsetHeight''); //find max height maxH = offH.max(); // apply a filler to make the selected elements equal in height els.each( function(el,idx){ var gap = maxH - offH[idx]; if(gap > 0) { var F = Builder.node(''b'',{className:''gapfill''}); //F.setStyle({''height'':gap+''px'',''display'':''block''}); // ERROR IN IE7 Element.setStyle(F,{''height'':gap+''px'',''display'':''block''}); //THIS WORKS el.appendChild(F); } }); }; An error happens using IE7 either with SAU 1.7.0 or 1.7.1b1 & included prototype. What''s wrong with this? (except that browser beast ;) Alessandro </pre> <pre wrap=""> </pre> </blockquote> <pre wrap=""><!----> </pre> </blockquote> <br> --~--~---------~--~----~------------~-------~--~----~<br> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. <br> To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <br> To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <br> For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en <br> -~----------~----~----~----~------~----~------~--~---<br> </body> </html> <br>