I've scratched my previous attempts at changing an ID attribute. Is there a way I can make the content below auto load if the requests === 0? Rather than having a click function.
<script language="javascript">
var requests = 10;
function request(self)
{if(self.href != "#")
requests -= 1;
if(requests === 0)
var pageid = function () {
var thisID = null;
$('#step').click(function () {
thisID = this.id;
$('#content').animate({
height: getPageHeight()
},
700, function () {
$('#next-page').fadeIn(500);
$('#content-' + thisID).fadeIn(500, function () {});
});
return false;
});
};
$(window).load(pageid);
function getPageHeight() {
var windowHeight;
if (self.innerHeight) windowHeight = self.innerHeight;
else if (document.documentElement && document.documentElement.clientHeight) windowHeight = document.documentElement.clientHeight;
else if (document.body) windowHeight = document.body.clientHeight;
return windowHeight;
}}
</script>