But you are clicking the <a> tag when its done!!.... and the event for the <a> is bubbling up the chain and trying to goto the href....
you need to change the code to do event delegation. example your <tr> has the id of "foo" -> <tr id="foo"> $('foo').observe('click',function(event){ Event.stop(event); // stops the continuing of following the href of the <a> tag }); If you want to stop it doing this you will have to find some way of passing the other variables your script needs by using observe.... You could use a classname or you could hide a hidden form element inside the first <td> below <tr id="foo"> and store the values in there which would make the code something like.... (untested) html... <tr id="foo" class="odd"> <td><input class="hiddenElement" type="hidden" value="myItem,1" /> ......................... </tr> $('foo').observe('click',function(event){ var variables=$(this).next('.hiddenElement'); var varz=variables.split(","); // check the syntax on this one!! showPopup(this, varz[0], varz[1]); Event.stop(event); // stops the continuing of following the href of the <a> tag }); Its psuedo code but it will put you on the right track Alex Mcauley http://www.thevacancymarket.com ----- Original Message ----- From: "Jason Frisvold" <xenopha...@gmail.com> To: <prototype-scriptaculous@googlegroups.com> Sent: Friday, August 21, 2009 2:10 PM Subject: [Proto-Scripty] Re: Div Fades > > 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" <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 >>> >>>> >>> >> >> >> > > > > -- > --------------------------- > 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 -~----------~----~----~----~------~----~------~--~---