Hi I´m new here so first of all a big hello to everyone ... take a look at this ... www.holviks.se/login.html its a custom scrollbar and a accordion .. the only problem is that I cant seem to figure out how to make the scrollbar (slider.js) handle height to update correctly when the div height of the accordion changes ... it updates correctly on resize window because i have a Event observe on windows resize. But there must be some way in prototype to detect if a div height have changed and update the scrollbar handle height when that happends .. www.holviks.se/login.html I gues this is simple stuff for you pro users ... but I´m new to this ... --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I´ve seemed to fix the issue a little bit with a custom event .. but the fix is yerky and wont update the scroll handle height smoothly .. when the accordion is expanded I send a custom event that tells the scrollbar to update .. but hey there must be some simple way to monitor a div in prototype .. For example say that I have a <div id="content">bla bla bla</div> and then sudenly that div is updated with some new content <div id="content">hfkjdahsfkjdsah hfkdjahf</div> then there must be some kund of onChange function that can tell the scrollbar that the div have changed ???? On 4 Juni, 09:22, gotfredsen <andr...-aVTieWoruj3LoDKTGw+V6w@public.gmane.org> wrote:> Hi > > I´m new here so first of all a big hello to everyone ... > > take a look at this ...www.holviks.se/login.html > > its a custom scrollbar and a accordion .. > > the only problem is that I cant seem to figure out how to make the > scrollbar (slider.js) handle height to update correctly when the div > height of the accordion changes ... > > it updates correctly on resize window because i have a Event observe > on windows resize. > > But there must be some way in prototype to detect if a div height have > changed and update the scrollbar handle height when that happends .. > > www.holviks.se/login.html > > I gues this is simple stuff for you pro users ... but I´m new to > this ...--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
No, there are no system events for when elements'' sizes or contents have changed. Working with dynamically changing element heights is a pain in the ass. :-) Even worse across browsers.... -Fred On Wed, Jun 4, 2008 at 6:33 AM, gotfredsen <andreas-aVTieWoruj3LoDKTGw+V6w@public.gmane.org> wrote:> > I´ve seemed to fix the issue a little bit with a custom event .. but > the fix is yerky and wont update the scroll handle height smoothly .. > > when the accordion is expanded I send a custom event that tells the > scrollbar to update .. but hey there must be some simple way to > monitor a div in prototype .. > > For example say that I have a <div id="content">bla bla bla</div> > > and then sudenly that div is updated with some new content <div > id="content">hfkjdahsfkjdsah hfkdjahf</div> > then there must be some kund of onChange function that can tell the > scrollbar that the div have changed ???-- Science answers questions; philosophy questions answers. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
gotfredsen wrote:> I´ve seemed to fix the issue a little bit with a custom event .. but > the fix is yerky and wont update the scroll handle height smoothly .. > > when the accordion is expanded I send a custom event that tells the > scrollbar to update .. but hey there must be some simple way to > monitor a div in prototype .. > > For example say that I have a <div id="content">bla bla bla</div> > > and then sudenly that div is updated with some new content <div > id="content">hfkjdahsfkjdsah hfkdjahf</div> > then there must be some kund of onChange function that can tell the > scrollbar that the div have changed ???? >If the div is updated using Prototype''s Element#update, you could fire a custom event from the update function to alert other scripts of the change: (function() { var oldUpdate = Element.Methods.update; Element.addMethods({ update: function(element, html) { element = $(element); var oldHtml = element.innerHTML; oldUpdate(element, html); element.fire(''dom:update'', {prevValue: oldHtml, newValue: html}); return element; } }); })(); $(''content'').observe(''dom:update'', function(event) { // update the scrollbar however scrollbar.update(); }); - Ken Snyder --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---