Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function shift_grid_east() {
- $(".y-div", $sprite_area).each(function() {
- var cache = $(this).children(".tile").filter(function() {
- return ($(this).css('display') != 'none');
- });
- cache.last().hide();
- if (cache.first().prev(".tile").show().length == 0)
- $(this).prepend("<div class='tile'></div>");
- });
- }
- function shift_grid_west() {
- $(".y-div", $sprite_area).each(function() {
- $(".tile", $(this)).filter( function(){
- return ($(this).css('display') != 'none');
- }).first().hide();
- });
- var found = $(".y-div", $sprite_area);
- found.each(function() {
- var found2 = $(this).children(".tile").filter(function(){
- return ($(this).css('display') != 'none');
- }).last().next(".tile");
- found2.show();
- if (found2.length == 0) {
- $(this).append("<div class='tile'></div>");
- }
- });
- }
Add Comment
Please, Sign In to add comment