PDA

View Full Version : Dynamic Ajax Content - set link to focus on contentarea div



pixelboxdesign
09-30-2013, 04:42 PM
1) Script Title: Dynamic Ajax Content

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm#.Ukmo7YZtjmk

3) Describe problem: Trying to have the dynamic content link to also set the browser to focus the contentarea div.

Hi,

I'm trying to figure a way to have the link that loads the external html file into the contentarea div to also set the browser to focus the contentarea div. Basically so that if you have a long list of links which scrolls the browser to the point where the content div is no longer visible, the browser window will return to focus the content when it loads.

Any suggestions will be much appreciated.

Beverleyh
09-30-2013, 05:44 PM
You could fake a "jump to" anchor via the onclick event? http://stackoverflow.com/questions/11815295/javascript-inline-onclick-goto-local-anchor

If you need further help, please provide a link to your page.

molendijk
09-30-2013, 05:48 PM
Or, if you just want to go to the top of the page:

<a href="javascript:ajaxpage('ajaxfiles/external2.htm', 'rightcolumn');" onmouseout="window.scrollTo(0,0)">Ferrari Page</a>

pixelboxdesign
10-04-2013, 08:19 PM
Thanks. The onmouseout was doing some weird bouncy thing with the page but I changed it to onclick and it seems to work a treat.