One more solution to try:
$('a.shownext').click(function(e) {
e.preventDefault();
// Code here
});
On 12/31/06, smoore <[EMAIL PROTECTED]> wrote:
Hi Karl, I was using return false; but still had no luck. I'm wondering if
you can't stop the page from jumping back to the top since the browser's
scrollbars expand/contract when you slide the content down/up.
It would seem odd if that was the case, but it also seems a bit odd that I
couldn't find any discussions on this issue. I did a couple searches on
this
forum and also on Google, but didn't really find any relevant results.
You can set the href to #something and then add at the point of the
link
which sort of works. You don't jump back to the top, but the section with
will jump to the top.
It's not the desired effect though and it'd seem like you should be able
to
handle it with JavaScript.
Karl Swedberg-2 wrote:
>
> Hi Scott,
>
> It looks like you just need to add a return false; after
> the .slideDown() and .slideUp()
>
> For example:
> $('a.shownext').click(function() {
> $(this).next().slideDown('slow');
> return false;
> });
>
> In other words, you need to prevent the default action from occurring.
>
> --Karl
> _________________
> Karl Swedberg
> www.englishrules.com
> www.learningjquery.com
>
>
>
> On Dec 30, 2006, at 9:29 PM, smoore wrote:
>
>>
>> I don't think I provided enough explanation. I have a page that has
>> a link
>> about half way down. When you scroll the page down to bring the
>> link closer
>> to the top, and then click the link, the page jumps back to the top
>> and then
>> the content slides open. The same happens when hiding the content.
>>
>> On the href, I've tried using # and javascript:void(0), but the
>> page still
>> jumps back to the top.
>>
>>
>> Matt Stith wrote:
>>>
>>> The only way i can think would be to make some kind of transparent
>>> object
>>> that is down near the bottom of the object being slid up, but the
>>> reason
>>> it
>>> scrolls up is because theres nothing else down there.
>>>
>>> On 12/30/06, smoore <[EMAIL PROTECTED]> wrote:
>>>>
>>>>
>>>> What's the best way to prevent a page from scrolling back to the
>>>> top when
>>>> using slideUp/slideDown near the bottom of the page?
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/Stop-page-scroll-when-using-slideUp-
>>>> slideDown-tf2900175.html#a8102742
>>>> Sent from the JQuery mailing list archive at Nabble.com.
>>>>
>>>>
>>>> _______________________________________________
>>>> jQuery mailing list
>>>> [email protected]
>>>> http://jquery.com/discuss/
>>>>
>>>
>>> _______________________________________________
>>> jQuery mailing list
>>> [email protected]
>>> http://jquery.com/discuss/
>>>
>>>
>>
>> --
>> View this message in context: http://www.nabble.com/Stop-page-
>> scroll-when-using-slideUp-slideDown-tf2900175.html#a8103795
>> Sent from the JQuery mailing list archive at Nabble.com.
>>
>>
>> _______________________________________________
>> jQuery mailing list
>> [email protected]
>> http://jquery.com/discuss/
>
>
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
>
>
--
View this message in context:
http://www.nabble.com/Stop-page-scroll-when-using-slideUp-slideDown-tf2900175.html#a8107092
Sent from the JQuery mailing list archive at Nabble.com.
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/