You can see an example in this demo blog, click on the title of any post and see the fading effect when the page is loading.
How To Implement the Fade In Loading Effect
1) To put this fading effect on your blog, go to your Template > Edit HTML :2) Click anywhere inside the code area and search for the </head> tag using CTRL + F keys:
3) Then, just above </head> add the following code:
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js' type='text/javascript'/>4) Save the changes and that's it. In green you can see where to change the color that fades on a loading page.
<script type='text/javascript'>
//<![CDATA[
$(document).ready(function() {
$("body").css("z-index", "-10");
$("body").fadeIn(0);
$("a").click(function(event){
event.preventDefault();
linkLocation = this.href;
$("body").fadeOut(500, redirectPage); });
function redirectPage() {
window.location = linkLocation;
}
});
//]]>
</script>
<style>
html {
background-color: #F2F2F2; /* Color fading */
}
</style>
The original script hides the body of the page while loading, I prefer to change that property with a negative z-index to avoid problems with the search engine robots that may effect the positioning.
Problems?
Consider that such effects could increase the blog loading time, so I recommend using it only when your blog loads fast and does not have too many scripts.
If you already use another version of jQuery remove the other, leaving only this which will be readed first.
If you are using Mootools or Scriptaculous, then you have to make some modifications to the code in order to be compatible.
If you have another script with a fade effect, then it could interfere with this and you might not see anything on the page except the color fading, in such cases it is better without this script.
You can also use this effect only on some links, for example, if you want to appear only when you click on the post titles in the navigation links (older posts and newer posts), and on the top tabs, then replace this line:
$("a").click(function(event){With this:
$(".post-title a, .blog-pager-older-link, .blog-pager-newer-link, .tabs").click(function(event){In some cases, the page can load for a second and then load with the fade effect, this may be "normal" because the browser is slow to read the script on page load.
Apart from these drawbacks, I think it's a very elegant way to load blog pages while browsing them, don't you think?
Technology Laws and lawyers ACCIDENT AND INJURY ATTORNEY Nunavut culture Health · Car Accident Lawyers Technology Blogs domain name yahoo Blogs Based On Donations · Mortgage Adviser Cord Blood mesothelioma claim Hosting Fastest VPS hosting WebHostingHub Insurance SEO Recovery Classes Geographical Location of the Visitors DUI ATTORNEY ORLANDO Attomey ANNUITY SETTLEMENT Donate your car Sacramento Tourism or Travel Rehab Loans MISSISSIPPI MESOTHELIOMA LAWYER Mortgage Credit Software How much to sell domain name for Transfer Dreamhost Donate Conference Call All topics related to traffic from USA Lawyer iPage mesothelioma attorneys california Donate Car to Charity California Claim Treatment online making money Trading Degree Donate Car for Tax Credit Attormey Gas/Electricity Donate your car for kids Mesothelioma Law Firm structured settlement buyer donate old cars to charity STRUCTURED ANNUITY SETTLEMENT NUNAVUT CULTURE DAYTON FREIGHT LINES Bluehost mesothelioma survival rates structured settlement annuity companies structured settlements annuities mesothelioma suit
0 comentarios:
Publicar un comentario