Javascript not functioning when “examplelink.php#anchor” is clicked?

Hmmm.... The problem, if I understand correctly, is that the browser jumps down to the fragment anchor position when arriving from another page, before the SmoothScroll object is loaded. The first thing that comes to mind would be a solution that uses sessions or cookies When a user is on the index page and clicks on a link to portfolio that should scroll to the blogg anchor: Instead of adding the hashtag fragment to the URL of the link, save a cookie that indicates the page should be scrolled and link directly to the top of the portfolio page Then, in the portfolio page domready event, load the SmoothScroll object, check for the presence of the cookie, scroll to the blogg anchor if it exists, and remove the cookie.

Hmmm.... The problem, if I understand correctly, is that the browser jumps down to the fragment anchor position when arriving from another page, before the SmoothScroll object is loaded. The first thing that comes to mind would be a solution that uses sessions or cookies. When a user is on the index page and clicks on a link to portfolio that should scroll to the #blogg anchor: Instead of adding the hashtag fragment to the URL of the link, save a cookie that indicates the page should be scrolled and link directly to the top of the portfolio page.

Then, in the portfolio page domready event, load the SmoothScroll object, check for the presence of the cookie, scroll to the #blogg anchor if it exists, and remove the cookie.

Yes, you understood my question perfectly! :) But I need a more spesific answer if that could be possible. I'm not sure how to do it!

Thank youu! :) – Inger-Marie Nov 23 '10 at 13:52.

Take a look at this: davidwalsh.name/mootools-onload-smoothsc... window. AddEvent(‘domready’, function() { new SmoothScroll({ duration:700 }, window); var el = window.location.hash. Substring(1); // the hash if(el) { window.

ScrollTo(0,0); var scroll = new Fx. Scroll( window, { wait: false, duration: 700, transition: Fx.Transitions.Quad. EaseInOut } ); scroll.

ToElement(el); } }).

Yes, its the one from moo tools! :) davidwalsh. Name/smooth-scroll Your code almost seems to work!

:O But not quite.. It loads the page but does not scroll down to the anchor – Inger-Marie Nov 23 '10 at 13:59.

I also have a javascript code for smooth scrolling (this should work on all pages), but it does not work on the header anchor links when I'm in another page then portfolio.php. What can I do to get the javascript to function when I for example press "portfolio. Php#blogg" in the index.

Hmmm.... The problem, if I understand correctly, is that the browser jumps down to the fragment anchor position when arriving from another page, before the SmoothScroll object is loaded. The first thing that comes to mind would be a solution that uses sessions or cookies.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions