Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a dynamic football field

I need to create a football field and then have some sort of dropdown menu that chooses formations (like 4-4-2, 4-5-1 etc) and moves my players (more like circles with number/name) on that field to achieve the desired formation.

Any ideas on how should I begin ?

like image 780
moonbas3 Avatar asked Mar 18 '23 21:03

moonbas3


1 Answers

Like cfv1000 said, you should look into draggable & droppable in jQuery UI.


Here's a head start I made for you. It's not near complete.

With your identifiers for your element(s), just call draggable() like this:

$("#GKRedTeam").draggable();
$("#GKBlueTeam").draggable();

..and amongst many upcoming additions - set up proper HTML & CSS properties for it.

JsFiddle demo

like image 117
urbz Avatar answered Mar 26 '23 01:03

urbz