Drag source z index problem

Problem: I have correct and incorrect icons that I put above drag sources in timeline so they should have higher z index than drag sources but when the icons show, they are behind the drag source images and it looks bad. How can I fix this?

ActivePresenter version: 9

OS: Windows 10

Hi Aytug,

This is due to the fact that the z-order is reset when drag sources are dropped into drop targets to ensure that the drag source is above the drop target, and the later dropped drag source is always above the earlier one if there are numerous drag sources dropped into 1 drop target.
If you want the correct/incorrect icons to be on top of other objects, please add the following JavaScript to the slide’s On Load event to set the z-order for the icons:

// update object names
var objectNames = ['Shape_10', 'Shape_11'];

// don't change code below
var zIndex = 2000;
for (var i = 0; i < objectNames.length; ++i) {
    var object = prez.object(objectNames[i]);
    if (object) {
        object.node.style.zIndex = zIndex;
    }
}

Note that Shape_10 and Shape_11 are the names of the 2 correct/incorrect icons in our example.

Best regards,
Hang

1 Like