PDA

View Full Version : Ajax pagination & Anchor link?



hycsos
12-11-2008, 10:16 PM
Hello
I need some help!
I use Ajax pagination at this adress http://www.dynamicdrive.com/dynamicindex17/ajaxpaginate/index.htm

Can I use an anchor link with ajax pagination like this:
<a href="javascript:mybookinstance.selectpage(1)#anchor">Select 2nd page dynamically to an anchor point in this page</a>
But this method don't work and I don't know what to do!

Can you help me to find some solution to link "javascript:mybookinstance.selectpage(1)" with an anchor

Thank you

Snookerman
12-11-2008, 10:41 PM
Try adding it to the JavaScript link list (step 2 on DD script page):

<script type="text/javascript">

var bookonflowers={
pages: ["demofiles/flower.htm#anchor", "demofiles/flower.htm", "demofiles/flower2.htm", "demofiles/flower3.htm", "demofiles/flower4.htm"],
selectedpage: 0 //set page shown by default (0=1st page)
}

var mybookinstance=new ajaxpageclass.createBook(bookonflowers, "bookcontent", ["paginate-top", "paginate-bottom"])

</script>
Then the link is just like normal:

<a href="javascript:mybookinstance.selectpage(0)">Select 2nd page dynamically to an anchor point in this page</a>