Draggable JS Bootstrap modal - performance issues

后端 未结 6 1137
感情败类
感情败类 2021-02-02 02:59

For a project at work we use Bootstrap Modal windows in JavaScript. We would like to make some of the windows movable, but we are running into performance issues with JQuery.

6条回答
  •  北海茫月
    2021-02-02 03:32

    I found a few ways to fix this.

    Adding this to your CSS file will disable the transition effects while the modal is being dragged. It appears however that once the user drags the box the fly in will not occur correctly but rather it will just fade in.

    .modal.fade.ui-draggable-dragging {
        -moz-transition: none;
        -o-transition: none;
        -webkit-transition: none;
        transition: none;
    }
    

    Alternatively adding the following to your CSS file and the nofly class to your model will disable the fly in all together but not the fade in:

    .modal.fade.nofly {
        top: 10%;        
        -webkit-transition: opacity 0.3s linear;
        -moz-transition: opacity 0.3s linear;
        -o-transition: opacity 0.3s linear;
        transition: opacity 0.3s linear;
    }
    

提交回复
热议问题