Search Results

Search found 18 results on 1 pages for 'devyn'.

Page 1/1 | 1 

  • How to move an element in Diagonal Movement in jQuery?

    - by Devyn
    Hi, I know how to move up and down an element in jQuery. $("#div").animate({"left": "+=100"}, 1000); //move 100px to the right But I have no idea to move in diagonal movement. I'm doing chess board and I don't know how to move Bishop with effect. Please have a look at following URL http://chess.diem-project.org/ I did like this... but it's not a proper way. for(var i = 0;i<50;i++){ // move down and move right 1 pixel at a time to get effect $("#div").animate({"left": "+="+x}, 1); $("#div").animate({"top": "+="+x}, 1); } Any idea? Really appreciate your helps!

    Read the article

  • jQuery animate() and appendTo() problem

    - by Devyn
    Hi! I'm doing a chess game. In there, I want to move an element with effect and then append it to new div. Following is my code. //--> #p70 is just ablove #p80 //--> each square is 64px $('#p80').animate({bottom:'+=64px'},500); //--> move one square above $('#b70').append($('#p80')); //--> append the animated element to owner 'div' The problem is, it moves 2 square( equivalent to 128px) where I only did is 64px. Here is my page and if you click the white square just above the pawn, you'll see the problem. I've tried adding delay(1000) and even javascript setTimeout but nothing works :( Really appreciate your helps in advance!

    Read the article

  • PHP with DB backed-end application to complete windows EXE possible or not?

    - by Devyn
    Hi, Let's say I have a php application backed-end with SQLite and I would like to convert whole application to exe file so the end user can just click it and run on windows. User should be able to save, update and add new data into database without any web server or browser things. Is it possible? I found out that we can use PHP-GTK for UI. exeoutput.com supports with database engines according to it's website. Anyone have tried it out? If I'm missing something, pls share with me. Thanks all in advance and happy new year!!!

    Read the article

  • How to call Json objects dynamically?

    - by Devyn
    Hi, I have like this var house = {'floor':{'one':'3 people','two':'1 people'}} var tmp = 'one'; and I want to call like this.. console.log(house.floor.tmp) // expecting '3 people' result tmp value will get from somewhere dynamically but it's not working. How can I solve this?

    Read the article

  • Which one should I choose AMQP or XMPP for real-time browser-based game?

    - by Devyn
    Hi, I'm choosing between AMQP (RabbitMQ) vs XMPP (eJabberd) for my browser-based flash-free javascript powered real-time turn-based game. I don't know much about AMQP and XMPP protocol. I would like to use PHP for user-authorization and some data store-retrieve with MySQL. As far as I found out, RabbitMQ has PHP clients but eJabberd not. What I understood is javascript client calls PHP script and manipulate necessary processing and then pass to AMQP or XMPP server to pass the data to opponent player. There is a good book 'Pro XMPP Programming with JS and jQuery' from Wrox but there is no example with PHP. So following are my questions. 1) Which protocol is suit for my game? 2) Shall I choose RabbitMQ just for it's PHP client support?

    Read the article

  • How to store or share live data between PHP Requests?

    - by Devyn
    Hi, I want to start a project for facebook and the application will be like real-time multiplayer chess game. The problem I'm having is I have no idea how to store the data when a player moves one piece and update the new position in player2 browser. I'm gonna use PHP, MySQL for server side and jQuery for Client Rendering. The simplest idea is to store the data in XML or MySQL and re-generate the result to player2 browser. But I know that when thousand of players are playing, it will not be an efficient way. Since I don't have time to study new language for this project, I'm gonna have to stick with PHP. I'm not going to use flash either because I want my client side light-weight and flash-free. So is there any way that will solve my problems?

    Read the article

  • How to replace '<p>' with '<li>' in an array in jQuery?

    - by Devyn
    Hi, Let's say I have this $(document).ready(function() { var array = $.makeArray($('p')); $(array).appendTo(document.body); }); }); <p>how</p> <p>are</p> <p>you</p> <p>baby?</p> If I want to replace <p> with <li> and expected output is ... <li>how</li> <li>are</li> <li>you</li> <li>baby?</li> What should I do? Thanks in advance!

    Read the article

  • How to join nearly identical several queries into one?

    - by Devyn
    Hi, Assume I have an order_dummy table where order_dummy_id, order_id, user_id, book_id, author_id are stored. You may complain the logic of my table but I somehow need to do it that way. I want to execute following queries. SELECT * FROM order_dummy WHERE order_id = 1 AND user_id = 1 AND book_id = 1 ORDER BY `order_dummy_id` DESC LIMIT 1 SELECT * FROM order_dummy WHERE order_id = 1 AND user_id = 1 AND book_id = 2 ORDER BY `order_dummy_id` DESC LIMIT 1 SELECT * FROM order_dummy WHERE order_id = 1 AND user_id = 1 AND book_id = 3 ORDER BY `order_dummy_id` DESC LIMIT 1 Please keep in mind that several numbers of same book is included in one order. Therefore, I list order_dummy_id by descending and limit 1 so only LATEST ORDER of A BOOK is shown. But my goal is to show other books in that way in one table. I used group by like this ... SELECT * FROM order_dummy WHERE order_id = 1 AND user_id = 1 GROUP BY book_id but it only shows order_dummy_id with ascending result. I have no idea anymore. Looking forward your kindness help!

    Read the article

  • How to save value of an element selected by the array style in jQuery ?

    - by Devyn
    Let's say we have following this: <p class="first">This is paragraph 1.</p> <p class="second">This is paragraph 2.</p> <p id="third">This is paragraph 3.</p> <p>This is paragraph 4.</p> We can save the value of an element in value variable and show like this. var value = $('p').slice(3,4); value.text(); // result --> This is paragraph 4 Above way has no problem if we know the number of element but we'll get problem if we have a lot of elements and we want to do with looping. why I get error if I do like this? $('p')[3].text(); What should I do if I want to loop and get values?

    Read the article

  • How to refresh jQuery Selector Value after an execution?

    - by Devyn
    Hi, I have like this. $(document).ready(function() { var $clickable_pieces = $('.chess_piece').parent(); $($clickable_pieces).addClass('selectee'); // add selectee class var $selectee = $('.chess_square.selectee'); // wait for click $($selectee).bind('click',function(){ $('.chess_square.selected').removeClass('selected'); $(this).addClass('selected'); { ........... } }); I initially inject 'selectee' class to all div which has 'chess_piece' class then I select DIVs with that class $('.chess_square.selectee'). <div id="clickable"> <div id="div1" class="chess_square"> </div> <div id="div2" class="chess_square selectee"> <div id="sub1" class="chess_piece queen"></div> </div> <div id="div3" class="chess_square"> </div> </div> There are two type of DIV element with class named 'chess_square selectee' and 'chess_square' which doesn't meant to be clickable. I move around Sub DIV of 'rps_square selectee' from DIV2 to DIV1 and add and remove classes to be exactly same like this. The meaning is Queen Piece is moved from Div2 to Div1. <div id="div1" class="chess_square selectee"> <div id="sub1" class="chess_piece queen"></div> </div> <div id="div2" class="chess_square"> </div> <div id="div3" class="chess_square"> </div> However, the problem is jQuery doesn't update var $selectee = $('.rps_square.selectee');. Even though I changed class names, DIV1 is not clickable and DIV2 is still clickable. By the way, I've used jQuery UI selectable but doesn't refresh either.

    Read the article

  • Static and Dynamic Scooping Problem

    - by Devyn
    Hi, I'm solving following code in Static and Dynamic Scooping. I got following answer but I need someone to confirm if I'm correct or not since I'm a bit confusing. I really appreciate if anyone can explain in simple way! Static => (1)8 (2)27 Dynamic => (1)10 (2)27 proc main var x,y,z; proc sub1 var x,z x := 6; z := 7; sub2; x := y*z + x; print(x); ---- (2) end; proc sub2 var x,y x := 1; y := x+z+2; print(y); ---- (1) end; begin x := 1; y:=3; z:=5; sub1; end

    Read the article

  • With PHP and AJAX, Can two clients inter-exchange data without MySQL?

    - by Devyn
    Hi, Let's assume I'm developing a AJAX, PHP chess game. During the game, one movement of a player will be notified to the another but we are not saving that information. Normally, we used to store in MySQL every time a player makes movement and show update position to another player. What I want is to reduce MySQL load as much as possible and server is not interested in movements between two players. Server will only save final result like who wins. So what should I do?

    Read the article

  • Background Image Overlapped Problem with jQuery

    - by Devyn
    Hi, Here is my working page. I attached buttons to white bishop and you can move around but left images are overlapped by right images. I think the problem is with CSS. The brief structure is here. <script> $(document).ready(function(){ $('#top').click(function(){ $('#p81').animate({top: "-=64px"}, 100); }); </script> <style> div.chess_board{ height: 512px; position: relative; width: 512px; } div.chess_square{ height:64px; position: absolute; width:64px; } div.chess_square.white { background: none repeat scroll 0 0 #ffffff; } . . . div.chess_piece{ background-image: url("sprite.png"); height: 64px; width: 64px; position: absolute; } div.chess_piece.bishot.white{ background-position: -64px 0; } </style> <div class="chess_board"> <div id="b81" class="chess_square white" style="top: 448px; left: 64px;"> <div class="chess_square_inner"></div> <div id="p81" class="chess_piece bishot white"></div> </div> </div> <input type="button" id="top" value="top" />

    Read the article

  • Help with MySQL Query?

    - by Devyn
    I have two tables rooms and users. I want to get only rooms.room_id, users.user_name with user_id = 1. I can get the result of all users with following sql... select rooms.room_id, rooms.user_id, users.user_name from rooms LEFT JOIN users ON rooms.user_id = users.user_id When I do like this to filter the result with user_id = 1 ... I got error. select rooms.room_id, rooms.user_id, users.user_name from rooms where rooms.user_id = 1 LEFT JOIN users ON rooms.user_id = users.user_id What should I do?

    Read the article

1