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

Forum

Log In Sponsors
Board index Programming JavaScript Forum

page keeps returning to the top

Postby qen on Fri Oct 24, 2008 2: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: 28
Joined: Wed Oct 22, 2008 7:10 pm

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

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


Just above the line I pointed you for the fix.
User avatar
rangana
500+ Club
 
Posts: 935
Joined: Wed Feb 27, 2008 5:14 am
Location: Cebu City Philippines

Postby qen on Fri Oct 24, 2008 3: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: 28
Joined: Wed Oct 22, 2008 7:10 pm

Postby rangana on Fri Oct 24, 2008 4: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.
User avatar
rangana
500+ Club
 
Posts: 935
Joined: Wed Feb 27, 2008 5:14 am
Location: Cebu City Philippines

Postby qen on Fri Oct 24, 2008 4: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: 28
Joined: Wed Oct 22, 2008 7:10 pm

Postby rangana on Fri Oct 24, 2008 4:58 am

I mean the link on how you implemented the gentle anchors, and not the gentle anchors script.
User avatar
rangana
500+ Club
 
Posts: 935
Joined: Wed Feb 27, 2008 5:14 am
Location: Cebu City Philippines

ftr way

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

Sorry, I'll have to give you and rtf file, it wont let me post that much code.

http://lovelago.googlepages.com/button_code.rtf
qen
 
Posts: 28
Joined: Wed Oct 22, 2008 7:10 pm

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

...and I don't feel any "gentleness".
User avatar
rangana
500+ Club
 
Posts: 935
Joined: Wed Feb 27, 2008 5:14 am
Location: Cebu City Philippines

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

If you try demo out here you'll see that the buttons are really nice, try "dropOut":

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


That's the effect I would like but I found all that came with it.. the .js and css too much to digest so I found this green version from the same guys, its just a proof of concept for now.

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

Thanks.
qen
 
Posts: 28
Joined: Wed Oct 22, 2008 7:10 pm

Postby rangana on Fri Oct 24, 2008 6:33 am

Yes, I saw that effect.

What I'm confused is what you mean by "gentle anchors".

Secondly, I'm confused on your how my suggestion works (partially), but not meeting your desire.

Could you work on a page where my suggestion were adapted.

...and on the other hand, another page in which the "effect" is missing base on the page where my suggestion was applied.

Hope that makes sense.
User avatar
rangana
500+ Club
 
Posts: 935
Joined: Wed Feb 27, 2008 5:14 am
Location: Cebu City Philippines

PreviousNext

Who is online

Users browsing this forum: No registered users and 10 guests