Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var x = 0;
- var y = 0;
- var moveMap = function (y,x){
- $.ajax({
- type: "GET",
- url: "index.php",
- data: "y="+y+"&x="+x,
- success: function (htmlCode){
- $('body').html(htmlCode);
- EventHandling.registerEvents();
- }
- });
- }
- $(document).ready(function(){
- EventHandling.registerEvents();
- init();
- });
- var EventHandling = {
- registerEvents: function(){
- $('span.left').click(
- function(){
- x++;
- moveMap(y,x);
- });
- $('span.right').click(
- function(){
- x--;
- moveMap(y,x);
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement