Determine which page a certain element is on?

70 Views Asked by At

I'm currently using paged.js to create a printable version of blogs that I have in HTML format. I'd like to create a Table of Contents so that when it's printed out, people can tell which page each chapter starts on. Basically, I make a placeholder table of contents, run a script to determine which page each chapter starts on, and then replace those placeholder numbers with the real page numbers.

There's a CSS property that can be used to keep track of page number and e.g. add the page number to the bottom-right of each page. I expected that I could use a CSS selector to find the beginning of each chapter and then somehow access this CSS property in JavaScript or using jQuery. However, searching through the DOM objects for these, I can't find any property that corresponds to that page number.

0

There are 0 best solutions below