On 08/21/2009 01:54 AM, Alex McAuley wrote:
>
> Jason.
>
> How are you calling these functions ?
>
> Are you using an <a> tag by any chance
Nope, I'm using an onclick method in a <tr> element like this :
<tr class='odd' onclick='showPopup(this, "myItem", 1);'>
<td>col 1</td>
<td>col 2</td>
<td>col 3</td>
<td>col 4</td>
<td>col 4</td>
<td>
<a href='?action=edit&id=1'>Edit</a>
<a href='?action=delete&id=1'>Delete</a>
</td>
</tr>
> Alex Mcauley
> http://www.thevacancymarket.com
> ----- Original Message -----
> From: "Jason Frisvold" <[email protected]>
> To: <[email protected]>
> 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
>> [email protected]
>> ---------------------------
>> "I love deadlines. I like the whooshing sound they make as they fly by."
>> - Douglas Adams
>>
>>>
>>
>
>
> >
--
---------------------------
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
-~----------~----~----~----~------~----~------~--~---