Advertisement
Adam_Wadsworth

Untitled

Feb 7th, 2012
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. <script type="text/javascript">
  2. function infinite_scroll_callback() {}
  3. jQuery(document).ready(function($) {
  4. $('.protected-post-form').center();
  5. $('#content').infinitescroll({
  6. debug : false,
  7. loading : {},
  8. state : {currPage : "1"},
  9. nextSelector : "div.navigation a:first",
  10. navSelector : "div.navigation",
  11. contentSelector : "#content",
  12. itemSelector : "#content div.post",
  13. pathParse : ["<?php echo $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] ?>page/", "/"]
  14. },
  15. function() { window.setTimeout(infinite_scroll_callback(), 1);}
  16. );
  17.  
  18.  
  19. function applyvote(elements){
  20. $(elements).each(
  21. $(".vote a").click(
  22. function() {
  23. var some = jQuery(this);
  24. var thepost = jQuery(this).attr("post");
  25. var theuser = jQuery(this).attr("user");
  26. jQuery.post("<?php bloginfo('template_url'); ?>/vote.php", {user: theuser, post: thepost},
  27. function(data) {
  28. var votebox = ".vote"+thepost+" span";
  29. jQuery(votebox).text(data);
  30. });
  31. });
  32. });
  33. }
  34.  
  35. $(elem).infinitescroll(options,applyvote(arrayOfNewElems));
  36.  
  37. });
  38. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement