Guest User

Untitled

a guest
Jan 24th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. function shift_grid_east() {
  2. $(".y-div", $sprite_area).each(function() {
  3. var cache = $(this).children(".tile").filter(function() {
  4. return ($(this).css('display') != 'none');
  5. });
  6. cache.last().hide();
  7. if (cache.first().prev(".tile").show().length == 0)
  8. $(this).prepend("<div class='tile'></div>");
  9. });
  10. }
  11.  
  12. function shift_grid_west() {
  13. $(".y-div", $sprite_area).each(function() {
  14. $(".tile", $(this)).filter( function(){
  15. return ($(this).css('display') != 'none');
  16. }).first().hide();
  17. });
  18.  
  19. var found = $(".y-div", $sprite_area);
  20. found.each(function() {
  21. var found2 = $(this).children(".tile").filter(function(){
  22. return ($(this).css('display') != 'none');
  23. }).last().next(".tile");
  24. found2.show();
  25. if (found2.length == 0) {
  26. $(this).append("<div class='tile'></div>");
  27. }
  28. });
  29. }
Add Comment
Please, Sign In to add comment