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
[email protected]
---------------------------
"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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---