Where the awesome is
Code in depth
Here, I will take some time to explain my jQuery/JavaScript code.
There's a lot of it, so hang tight and read through what you want. I'll do my best to explain everything I've done in a structured way.
I have turned my selectors into reference variables. This way I can use the reference variables instead of repeatedly having jQuery traverse the DOM and slowing down my page.
Click on the topics below to get an expanded view of why I coded these features the way I did:
The following code demonstrates what happens when you click on the "Powered" text at the bottom of the screen (line by line):
$('#power').click(function() {
$('#power').fadeOut(500, function() {
$(this).fadeIn('slow', function() {
$('p#second').replaceWith('<p id="second"><b class="highlight">Animation complete!</b></p>');
$('p#second').fadeOut(1500);
});
});
return false;
});
When the page loads, the header fades in.
$('#header').css("display", "none").fadeIn(3000);
I have chained this line together. When I first created it I had the following:
$('#header').fadeIn(3000);
When I did it this way, I also had the "header" id's css set to: display: none;
I realized though that when someone has JavaScript turned off in their browser, they couldn't see a header at all.
By chaining this code together, I can set the css property to 'none' through jQuery and then fade it in. This way, everyone can see the header and JavaScript users get an added treat.
Updated content coming soon...
Powered by YourName