最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - jQuery UI Draggable with Bootstrap layout - Stack Overflow

programmeradmin1浏览0评论

jQuery draggable elements goes under the bootstrap styled columns (col-*). For example, I have two .row each divided into 4 columns (with col-md-3). I am trying to get the first row columns to be draggable onto 2nd row droppable columns.

But when I drag 'Drag #' elements, they always go under the 'droppable' elements. I am not able to get drop working with Bootstrap styles.

Can someone explain why this is happening and provide a solution?

Bootply Exmple:

jQuery draggable elements goes under the bootstrap styled columns (col-*). For example, I have two .row each divided into 4 columns (with col-md-3). I am trying to get the first row columns to be draggable onto 2nd row droppable columns.

But when I drag 'Drag #' elements, they always go under the 'droppable' elements. I am not able to get drop working with Bootstrap styles.

Can someone explain why this is happening and provide a solution?

Bootply Exmple: http://www.bootply./THBX5GJnCn

Share Improve this question asked Dec 24, 2014 at 22:09 CoderTRCoderTR 5003 gold badges7 silver badges19 bronze badges 1
  • My guess is, its something other than z-index causing this problem? I am able to drag 'Drag 2' on top of 'Drag 1' but not other ways. Something to do with responsive UI CSS styles? – CoderTR Commented Dec 24, 2014 at 23:51
Add a ment  | 

1 Answer 1

Reset to default 2

Is seems that class .ui-draggable-dragging has lower `z-index' property than others

Adding sth like here:

.ui-draggable-dragging { z-index: 10000!important }

Here is jsfiddle which works: http://www.bootply./P0Okde8ZmV

Code above will fix the problem. Of course my 10000 value & !important are here just to show You solution. It's not so pretty to use !important each time, You can't get the clue of case :)

发布评论

评论列表(0)

  1. 暂无评论