问题描述:

I have some html markup:

<body>

...

<div id="mainContainer">

<div id="someDiv">...</div>

<div id="content">...</div>

</div>

...

</body>

And I have partial html page with markup like this:

    @foreach(var item in Model.Items)

    {

    }

This partial page I am loading into the main page into div with id="content". I am using jquery:

ajax.partial(

Url.Action("Action", "Controller"),

{},

function (data) {

$('#content').html(data);

makeDraggable();

},

function () {

alert('error!');

}

);

I am using asp.net mvc, and my Controller has Action that returns all needed data in Model.

My method makeDraggable() makes "a" items which have class "m-item" draggable:

makeDraggable() {

$('.m-item').draggable({

cursor: 'move',

opacity: 0.4,

stack: $('.m-item')

});

}

I added mCustomScrollbar to div with id="partialContainer".

if ($('#content').data().mCS_Init == undefined) {

$('#partialContainer').mCustomScrollbar({

scrollInertia: 0,

mouseWheel: "auto",

scrollButtons: {

enable: true

},

advanced: {

updateOnContentResize: true

}

});

}

Dragging works but "a" elements are not bringing to front! The problem is with using mCustomScrollbar and draggable option together. When I get rid of scrollBar it works fine (elements are bringing to front). But I need scrollBar! What should I do?

相关阅读:
Top