PDA

View Full Version : Making my prev/next links send me to the top of the page



mrsanj
07-12-2010, 07:31 PM
1) Script Title: Virtual Pagination Script v2.1

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

3) Describe problem: I'm using Demo3 on the the Virtual Pagination Script and it's working fine but for one thing - the pagination bar on the bottom of the page doesn't send me to the top of the prev/next pages, it sends me to the bottom, so I have to scroll up. I'm looking to find out how to tweak the code so that when I click prev/next or any of the page numbers on the bottom bar, it sends me to the top of the relevant page. Can you help? :)

ddadmin
07-12-2010, 10:25 PM
There's a couple of threads in the past that discuss this, for example: http://www.dynamicdrive.com/forums/showthread.php?t=41898

mrsanj
07-14-2010, 05:25 PM
Hi DDADmin,

Thanks for sending me that link. Unfortunately, the recommendations don't seem to be working for me.

What happens is that when I add the code to the function showpage () in the .js file:

var contentArea=document.getElementById(config.divid)
if (contentArea && contentArea.scrollIntoView)
document.getElementById(config.divid).scrollIntoView()

... I actually lose all functionality of the pagination - the page numbers no longer appear and the prev/next links don't work. I'm too new to javascript to diagnose why this is happening - bit of a rookie I'm afraid, so I'm rather dependent on experts like yourself. If there's anything you can do to help me, I'd really appreciate it - perhaps there's another thread on this topic, another technique? Or perhaps I could send you the html of my page - it's very straightforward really...

Any help much appreciated...

Thanks!

mrsanj

ddadmin
07-15-2010, 08:01 AM
There must be an error in your set up somehow. Try the below modified .js file instead, which adds the necessary code in.