0

I have a drag and drop code in jQuery, in which the elements are placed on one side and the other complete side is the space for the elements to be placed after dragging.

Then there is a simple html having the elements and a style sheet. This is just like tools which help us create different elements like buttons, clocks etc, like in ms word. After dropping the elements I want to save their position, in some style sheet. The final position of the elements is to be saved in a style sheet.

I do not know how to implement this, should it be generated automatically or how?

Oshadha
  • 546
  • 10
  • 25
user571
  • 1
  • 3
  • Why can't you save the position in javascript file? – Arun AK Jun 15 '16 at 05:17
  • Could you please share sample code which you tried in jsfiddle or codepen or screenshot? – Naga Sai A Jun 15 '16 at 05:17
  • i can show the position on console, console.log($(this).attr("id")); console.log(pos.left); console.log(pos.top); – user571 Jun 15 '16 at 05:18
  • using these commands, but i want a separate stylesheet, to show the position, actually to make a portal kind of thing.. and the final position should be saved, everytime the position is changed the stylesheet should be updated and saved. right now i have confined it to position only – user571 Jun 15 '16 at 05:20
  • I have used the following link for the jquery code.. https://www.placona.co.uk/166/javascript/a-more-elaborated-jquery-drag-drop-cloning/ – user571 Jun 15 '16 at 05:22
  • You can create a `data URI` or a blob url containing the results of `.css()` or other method. – guest271314 Jun 15 '16 at 05:22
  • okay, need to study that.. – user571 Jun 15 '16 at 05:24
  • but to save the positions in the .css() because that should be saved to save the changes and design – user571 Jun 15 '16 at 05:30
  • is it possible to create two buttons like save and new.. and then clicking on save should generate the final css? – user571 Jun 15 '16 at 05:58
  • create a css string and store it in localstore or db or generate a css dynamically – Nadeemmnn Mohd Jun 15 '16 at 06:40
  • Possible duplicate of [Export CSS of DOM elements](https://stackoverflow.com/questions/7754469/export-css-of-dom-elements) – Paul Sweatte Jun 30 '17 at 04:34

0 Answers0