Jason. How are you calling these functions ?
Are you using an <a> tag by any chance Alex Mcauley http://www.thevacancymarket.com ----- Original Message ----- From: "Jason Frisvold" <xenopha...@gmail.com> To: <prototype-scriptaculous@googlegroups.com> Sent: Thursday, August 20, 2009 9:17 PM Subject: [Proto-Scripty] Div Fades > > Hi there, > > I'm using appear and fade with a hidden div to display additional > information about data in a table. This all works wonderfully with one > caveat. Whenever the fade is called, the page jumps to the top, making > the user have to scroll back down again. > > Am I doing something incorrectly, or do I need to compensate for this > jump? Firefox 3.5, Prototype 1.6.0.3, Scriptaculous 1.8.2 > > The div is defined as follows : > > <div id='hoverdiv' style='display:none; position:absolute; top:0; > left:0;'></div> > > My ajax calls are as follows : > > function showPopup(myItem, detailType, id) { > myDiv = $('hoverdiv'); > myItem = $(myItem); > new Ajax.Updater('hoverdiv', 'getinfo.php?type=' + detailType + > '&id=' + id, > { > method: 'get', > onComplete: function() { > var myOff = myItem.cumulativeOffset(); > > var newX = myOff[0] + (myItem.getWidth() - > myDiv.getWidth()) / 2; > var newY = myOff[1] + > (myItem.getHeight() - > myDiv.getHeight()) / 2; > > myDiv.style.top = newY + 'px'; > myDiv.style.left = newX + 'px'; > > myDiv.appear(); > } > }); > } > > function hidePopup(myDiv) { > myDiv = $('hoverdiv'); > > myDiv.fade(); > } > > > -- > --------------------------- > Jason Frisvold > xenopha...@gmail.com > --------------------------- > "I love deadlines. I like the whooshing sound they make as they fly by." > - Douglas Adams > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---