I am trying to code a page that will allow users to read on on the same page rather than having to jump to page two or whatever the relevant "NEXT" is.
I can achieve this by pre-defining on the "main" page how many different pages it will have access as well as the links to each of those pages to load.
My question is can this be done, with the links being at the bottom of each page in the folder location, or can it only be achieved by pre-defining the links and div sections.
EG,
<div class="morebox">
<p>Halvah cheesecake wafer. Marzipan tart jujubes icing dessert cheesecake jujubes danish. Topping chocolate lemon drops.</p>
<p>Unerdwear.com danish unerdwear.com. Danish candy gingerbread cookie donut liquorice. Chocolate cake gummi bears toffee liquorice chocolate bar sweet soufflé applicake carrot cake.</p>
<p>Toffee bonbon ice cream wafer muffin applicake. Chocolate cake liquorice candy candy croissant bonbon jelly beans. Soufflé cotton candy donut biscuit danish. Jelly chocolate cake cotton candy unerdwear.com macaroon soufflé gummies tootsie roll.</p>
<p>Applicake icing cotton candy jelly-o pie cotton candy lollipop. Cupcake toffee cookie bonbon. Topping donut biscuit toffee apple pie.</p>
<p>Sugar plum marzipan jelly pie. Sugar plum biscuit sweet sugar plum bonbon. Wafer ice cream marshmallow.</p>
</div>
<div class="morebox-one"></div>
<a href="ajax_more.html" id="one">Click for More</a>
<div class="morebox-two"></div>
<a href="ajax_seconds.html" id="two">Click for More</a>
As you can see from the code above the links are included in the main page, but on the main page I would like it so that the only link showing is the one for whichever is the next relevant page to load.
The jQuery code I am using is
$("a").click(function(event){
var linkLocation = $(this).attr("href");
var ID = $(this).attr("id");
$("#"+ID).fadeOut(500);
$(".morebox-"+ ID).fadeOut(500, function () {
$(".morebox-"+ ID).load(linkLocation, function () {
$(".morebox-"+ ID).fadeIn(500)
});
});
return false;
});
This method would be fine for smaller documents, but longer pages that should be broken down to prevent longer page loads are what this script is really for.
Thanks for anyone looking at this question, and a virtual hi five to suggested solutions.