Advertisement
firoze

ajax auto refresh and rand /mt_rand image wordpress

Oct 29th, 2015
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. // ajax auto refresh and rand /mt_rand image wordpress
  2.  
  3. // first make a folder named images then put 0-9 image into (images) || image extension take care change when <img src="">
  4.  
  5.  
  6. <script>
  7. function updateCount () {
  8. jQuery("#counter").load(" ",function () {});
  9. }
  10. jQuery(function () {
  11. setTimeout(updateCount, 3000);
  12. });
  13. </script>
  14.  
  15. <div id="counter">
  16. <table width="0" border="0" cellspacing="0" cellpadding="0">
  17. <tr>
  18. <?php
  19. // $directory = get_template_directory_uri();
  20. echo '<td><img style="width:500px;height:300px;transition:ease 0.9s all"
  21. src="'.get_template_directory_uri().'/images/'.mt_rand(0,9).'.jpg" alt="." border="0" /></td>';
  22. ?>
  23. </tr>
  24. </table>
  25. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement