It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Partner Sites
Board index Programming JavaScript Forum

page keeps returning to the top

page keeps returning to the top

Postby qen on Fri Oct 24, 2008 12:56 am

The following page has an #bottom request which links to a piece of .js to make it flow nicely to the bottom of the screen, but when I added the JQuery (green) button the page just kept returning to the top.

Why is it doing this?

Click the "Description" button to see:

http://lovelago.googlepages.com/test8.html
qen
 
Posts: 27
Joined: Wed Oct 22, 2008 8:10 pm

Postby rangana on Fri Oct 24, 2008 1:10 am

That's odd, it only appears to be happening only on IE.

Have you tried to report the bug on JQUEry on the easing plugin?
~ Get me some work, I do freelancing ~
User avatar
rangana
500+ Club
 
Posts: 929
Joined: Wed Feb 27, 2008 6:14 am
Location: Cebu City Philippines

Postby qen on Fri Oct 24, 2008 1:38 am

Nope. But I should think its my implementation of the code. I am using FireFox btw.
qen
 
Posts: 27
Joined: Wed Oct 22, 2008 8:10 pm

Postby rangana on Fri Oct 24, 2008 1:42 am

Problem is not reproducible on FF, is it on your end?
~ Get me some work, I do freelancing ~
User avatar
rangana
500+ Club
 
Posts: 929
Joined: Wed Feb 27, 2008 6:14 am
Location: Cebu City Philippines

it must be v2 FF

Postby qen on Fri Oct 24, 2008 1:50 am

Yes, that's what I use. You mean to say that the website does not scroll back to the top? I am using v2.0.0.14. You know what. Its not happening in Safari. So it's my old browser, sorry about that.
qen
 
Posts: 27
Joined: Wed Oct 22, 2008 8:10 pm

Postby rangana on Fri Oct 24, 2008 2:43 am

I'm using FF3, and it's normal the same as Opera and Safari.

IE is the only browser at my end which fails.
~ Get me some work, I do freelancing ~
User avatar
rangana
500+ Club
 
Posts: 929
Joined: Wed Feb 27, 2008 6:14 am
Location: Cebu City Philippines

Postby qen on Fri Oct 24, 2008 2:48 am

The thing is, in FF2 anyway the animation of that green button occurs at the top left of the screen but the button is at the bottom right, naturally I want the animation at the bottom right, any help with that please ..is it a CSS problem?

Sorry, I'm just sticking stuff together here, trying to make a nice site. Trying my best.
qen
 
Posts: 27
Joined: Wed Oct 22, 2008 8:10 pm

Postby rangana on Fri Oct 24, 2008 3:00 am

Try to report it first, it appears that the problem is in jquery itself.

Anyway, you could change this part of your script:
Code: Select all
$(this).hide("slide", { direction: "down" }, 500);


to:
Code: Select all
$(this).animate({height:'toggle'},500);


Hope it works.
~ Get me some work, I do freelancing ~
User avatar
rangana
500+ Club
 
Posts: 929
Joined: Wed Feb 27, 2008 6:14 am
Location: Cebu City Philippines

thanks.. again

Postby qen on Fri Oct 24, 2008 3:08 am

Oh it works, thank you very much! I bet you wished you charged it now, ha ha. Seem as though you know about this sort of stuff, how would I make that button the "Description" link button?

P.S. I did post about that before, like you said, but the JQuery forum takes ages to show messages up and so I'm still waiting.
qen
 
Posts: 27
Joined: Wed Oct 22, 2008 8:10 pm

Postby rangana on Fri Oct 24, 2008 3:10 am

What do you mean? You want that "green" div to toggle (show/hide) when the "description" texts is clicked?
~ Get me some work, I do freelancing ~
User avatar
rangana
500+ Club
 
Posts: 929
Joined: Wed Feb 27, 2008 6:14 am
Location: Cebu City Philippines

Postby qen on Fri Oct 24, 2008 3:16 am

No, the green thing is a button (http://www.hotajax.org/jquery/photos--o ... rails.html) but from the website it was green, I think it needs a css sheet or something but to implement that was too complicated so I went for the shorter example here:

http://docs.jquery.com/UI/Effects/Slide#source

What I wanted was for my site to be an entire page, but with scrollbars dissabled the means of scrolling was to use this animated 'green' button, thus it collapses and the page magically pulls up. So I found a script to make the page go up (scroll down) when a link was clicked, with the ultimate aim of making the 'green' button make that happen.

So now I need to make the green button do what the "Description" link does, behave like a button. Get rid of the Description link, it was only there as a proof of concept test.

If you understand what I mean?

Thanks
qen
 
Posts: 27
Joined: Wed Oct 22, 2008 8:10 pm

Postby rangana on Fri Oct 24, 2008 3:48 am

Try to add:
Code: Select all
location.href=location.href+'#nav-descrip';


Just above the line I pointed you for the fix.
~ Get me some work, I do freelancing ~
User avatar
rangana
500+ Club
 
Posts: 929
Joined: Wed Feb 27, 2008 6:14 am
Location: Cebu City Philippines

Postby qen on Fri Oct 24, 2008 4:12 am

Thanks, it does work, but ignores the javascript that makes the 'Gentle Anchors' smooth transition, I tried to introduce that into the button click(function() but it does not work for me:

<script type="text/javascript">
<h1 class="title">Gentle Anchors</h1>
<ol id="linklist">
$(document).ready(function(){
$("#thisDiv").click(function () {

location.href=location.href+'#nav-descrip';
</ol>

$(this).animate({height:'toggle'},500);
});
});


</script>


original Gentle Anchors:

</script>

<h1 class="title">Gentle Anchors</h1>
<ol id="linklist">
<a href="#nav-descrip">Description</a>
</ol>


Thanks for percevering.
qen
 
Posts: 27
Joined: Wed Oct 22, 2008 8:10 pm

Postby rangana on Fri Oct 24, 2008 5:37 am

I'm confused. Could you provide me a link on the "gentle anchors" you were telling.

Also, what's the purpose of hiding it when click? I"m confused on your goal.
~ Get me some work, I do freelancing ~
User avatar
rangana
500+ Club
 
Posts: 929
Joined: Wed Feb 27, 2008 6:14 am
Location: Cebu City Philippines

Postby qen on Fri Oct 24, 2008 5:44 am

Sure, its here:

http://lovelago.googlepages.com/gentle_anchors_1.1.js

The button animation is designed to collapse, so I need about a .5sec delay before the script activates to make itself disappear. I think that I can get away with that as you see from these examples of the real look of the button:

http://www.hotajax.org/jquery/photos--o ... rails.html

The selection of buttons gracefully fade away and there's a lot of white to them, that's he theme of my site. Then the page will scroll down to reveal the next page and another button will appear to bring you back up, if you want.

Its just the style I want.
qen
 
Posts: 27
Joined: Wed Oct 22, 2008 8:10 pm

Next

Return to JavaScript Forum

Who is online

Users browsing this forum: No registered users and 8 guests