Loading Page in JQuery

index.php

<script src="loading.js" type="text/javascript"></script>
<link media="screen" rel="stylesheet" type="text/css" href="slyte.css" />

<div id='loading' style='display: none;'>
     Loading...
</div>

<a onclick="activate_ajax_loading('content_1.html')" href="#content_1">content_1</a> |
<a onclick="activate_ajax_loading('content_2.html')" href="#content_2">content_2</a>

slyte.css

<style>
#container { line-height: 20px; width: 500px; height: 500px; margin: 20px 0; padding: 10px; border: 1px solid #999; }
// Loding Color is Blue
#loading { MARGIN-LEFT: 90%; position: absolute; top: 0; left: 0; color: white; background-color: blue; padding: 5px 10px; font: 12px Arial; }
// Loading Color is red
#loading { position: absolute; top: 0; left: 0; color: white; background-color: red; padding: 5px 10px; font: 12px Arial; }
</style>

Loading.js

<script type='text/javascript'>
activate_ajax_loading = function(url) {
   $('#loading').ajaxStart(function(){
       $(this).fadeIn();
   }).ajaxStop(function(){
       $(this).fadeOut();
   });
   $("#content").load(url);
}
</script>

<strong>content_1.html</strong>
<pre class="brush:php">content1.html</pre>
<strong>content_2.html</strong>
<pre class="brush:php">content2.html</pre>

17 thoughts on “Loading Page in JQuery

  1. Pingback: viagra us

  2. Pingback: cialis generic name

  3. Pingback: otc cialis

  4. Pingback: generic cialis online

  5. Pingback: Buy viagra with discount

  6. Pingback: Free viagra

  7. Pingback: cialis without a prescription

  8. Pingback: is there a generic for cialis

  9. Pingback: cialis discount

  10. Pingback: cialis manufacturer coupon 2019

  11. Pingback: is cialis generic

  12. Pingback: viagra 100mg

  13. Pingback: viagra 50mg

  14. Pingback: cheap viagra

  15. Pingback: best ed pills at gnc

  16. Pingback: buy erection pills

  17. Pingback: best erection pills

發表迴響