Thanks ryan But i want it the ajax with jsp application.So can u plz suggest?
On 5/1/09, ryan <ryansu...@gmail.com> wrote: > > > I figured it out > > Element.addMethods({getOffsetParent : function(element) { > if (element.offsetParent) return $(element.offsetParent); > if (element == document.body) return $(element); > > while ((element = element.parentNode) && element != document.body > && element != document) > if (Element.getStyle(element, 'position') != 'static') > return $(element); > > return $(document.body); > }}); > > this is a patch for prototype1.6.0.3 bug #11007 > > On May 1, 3:44 pm, ryan <ryansu...@gmail.com> wrote: > > I want to rewrite getOffsetParent of element object. > > I created a js file which is loaded after prototype file, and within > > it , I have following code > > ////////////////// > > Object.extend(Element, {getOffsetParent : function(element) { > > alert('get new offset');}}); > > ///////////////// > > which doesn't work, > > I also tried > > ///////////////////////// > > Element.getOffsetParent = function(element) { > > alert('get new offset');} > > ///////////////////// > > doesn't work either > > if i use Element.getOffsetParent, it's calling the new function, but > > if I call it like this > > ////////////////// > > var myelement = $('test'); > > myelement.getOffsetParent > > //////////////// > > it still call the native prototype function > > > > thanks in advance > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---