-
1. Re: How to scroll down to an anchor ?
nicomanzin Sep 27, 2012 1:52 PM (in response to nicomanzin)Ok, so, I found some interesting things, yet it's far from being done !
First, I found that I can jump to a particular position quite easely with window.scrollTo(x,y);
But I really want the transition to be smooth.
So I found this jquery plugin : http://flesler.blogspot.fr/2007/10/jquerylocalscroll-10.html
with the demo here : http://demos.flesler.com/jquery/scrollTo/
And now it's been like 3 hours that I try to make it work.
I've seen that you can just paste jquery commands in edge, you have to use a special syntax but I don't get it.
I'm still trying to figure out how to initiate the plugin, how to triger the event when clicking on a button, and lastly, how to define exactly where the window should scroll precisely...
If someone would be kind enough to explain me how to make this plugin work, this would be an appreciated help...
Thanks a lot !
-
2. Re: How to scroll down to an anchor ?
heathrowe Sep 27, 2012 3:22 PM (in response to nicomanzin)This sample goes without a plugin. It merely taps into the scrollTop() jQuery method.
See Sample: http://www.heathrowe.com/edge/scrolltop/scrollTop.html
On the sample page, I have 5 designated areas, nothing more than 5 'shapes'. Each one goes to another shape on the page, example 1>3, and so on. In the click event handler for any of the shapes, use the following:
////// Click Event ////////
////// Copy Code ///////
// Target the designated 'scroll to' element
var element = sym.$("Three");
// No Animation
//$(window).scrollTop(element.offset().top);
// With Animation
$('html,body').animate({scrollTop: element.offset().top}, "slow");//////End Copy Code////
////////////////////////////
Download Sample: http://www.heathrowe.com/edge/scrolltop/scrollTop.zip
More on jquery scrollTop, offset() and animate()
Hope this helps
Darrell
-
3. Re: How to scroll down to an anchor ?
nicomanzin Sep 27, 2012 10:40 PM (in response to heathrowe)Yes !
That's it !
Well thanks a lot, I was totally confused here...
It's perfectly working now
Yay !!
-
4. Re: How to scroll down to an anchor ?
Florian Steller Oct 5, 2012 8:46 AM (in response to heathrowe)How can I scroll in a div, without moving the whole page?
When I click button A, B or C, i want to scroll to point to a, b or c through a mask and stand the rest remain.Thank You!
-
5. Re: How to scroll down to an anchor ?
heathrowe Oct 5, 2012 9:57 AM (in response to Florian Steller)Hi Herr
Then you need to nest the elements into a parent div;
Set the parent div Visibility to 'hidden' from the Property Panel;
Then adjust the click handler target as follows
// Click Handler
var myDiv = sym.$("Rectangle");
myDiv.animate({scrollTop: element.offset().top}, "slow");
//
Preview sample.
Download sample.
Darrell
-
6. Re: How to scroll down to an anchor ?
Florian Steller Oct 8, 2012 7:04 AM (in response to heathrowe)Thanks for this fast answer! It works great.
I just ment an externel navigation. if I use the script on fix buttons, it crashes after the third button.
DEMO
DOWNLOAD
Thanks,
guesmo
-
7. Re: How to scroll down to an anchor ?
heathrowe Oct 8, 2012 10:44 AM (in response to Florian Steller)Looks good, Herr.
Darrell
-
8. Re: How to scroll down to an anchor ?
Florian Steller Oct 9, 2012 12:29 AM (in response to heathrowe)But the third button doesn´t work.
And if I click a button twice, the is some movement I jutst don´t wont...
Thanks,
guesmo
-
9. Re: How to scroll down to an anchor ?
heathrowe Oct 9, 2012 2:58 AM (in response to Florian Steller)I don't get a crash?
The additional movement is expected because, the second click recalculates the scrolltop value.
Darrell
-
10. Re: How to scroll down to an anchor ?
Florian Steller Oct 9, 2012 3:23 AM (in response to heathrowe)Now it works to click on an fix button and scroll to the expected div.
But if I clik on button 2 and finally on button three, the third div doesn´t scroll to the real Top. You can see the div, but it doesnt´t move to top.
So if you click different sequence react, the divs do not react the way it should
DEMO
DOWNLOAD
-
11. Re: How to scroll down to an anchor ?
Florian Steller Oct 9, 2012 3:27 AM (in response to Florian Steller) -
12. Re: How to scroll down to an anchor ?
heathrowe Oct 9, 2012 4:01 AM (in response to Florian Steller)Three doesnt scroll to the top, because there is nothing below it.
If Nothing below it, hence there is nothing to 'scroll'.
Hope that makes sense.
Darrell
-
13. Re: How to scroll down to an anchor ?
Florian Steller Oct 9, 2012 4:32 AM (in response to heathrowe)There is is enough space under point 3 (point 4 & 5). If you click on the button 3 first after the page has loaded, it goes right to the top. When you click first on button 2 and then button 3, it does not go right to the top.
And when I click on button 2 or 3 and then directly the same button again, the animation scrolls back to the first div.There has to be somthing to stop this behavior.
guesmo
-
14. Re: How to scroll down to an anchor ?
Henry Code Aug 20, 2014 7:40 AM (in response to heathrowe)Thanks buddy (Darrell) saved me time...was going crazy on such a simple solution. BIG UPS!
-
15. Re: How to scroll down to an anchor ?
QuadrantProductions Nov 12, 2014 9:48 AM (in response to heathrowe)Is there a way to scroll to an element on the page outside of the Animate object? So for example if you had an animate object loaded into a page in an iframe and you wanted to click an a button inside the animate object having it scroll to an anchor tag on the page?
Something like....
sym.getSymbol("MYANIMATEBUTTON").click(function(){
sym.$('html,body').animate({'thepageanchorname' : 0},1000);
});
the above didn't work but gives you an idea of what I'm thinking.
Cheers!



