How can I implement a touch-sensitive, responsive, sortable list supporting drag & drop for Bootstrap?

前端 未结 2 1036
梦谈多话
梦谈多话 2020-12-22 18:06

I have a

    list that I want to make sortable (drag & drop). How can I get it to work with Bootstrap 3 in modern browsers and touch devices?

    <
2条回答
  •  情深已故
    2020-12-22 18:50

    Just thought I'd post a supplemental answer to the one from @KyorCode. I followed his advice and went with JQuery Sortable and it worked seamlessly for me. It took me maybe 10 minutes to get this working.

    I didn't have to include any JQuery UI CSS - just the JavaScript - so there were no issues with the CSS conflicting in anyway with Bootstrap.

    Working Example:

    Here's a working example on www.bootply.com.

    HTML:

    
    
    • You can drag this panel.
      Content ...
    • You can drag this panel too.
      Content ...

    JavaScript:

    You can download JQuery Sortable without including the whole of JQuery UI in your page.

    
    
    
    
    

    CSS:

    
    

    HTH

提交回复
热议问题