Looking at the JS, I think I found the problem.
In the function ‘$DGD.placeBox = function (box)’, the plugin calculates the height of the wanted element, and converts it as a height rate, so it will act as a classical “scroll” setting. So the detector has to consider it as a scroll element. So I modified the condition to allow ‘element’ type:
$DGD.calcScroll = function () {
var scrolled = (document.body.scrollTop || parseInt(jQuery(document).scrollTop(), 10)),
rate = Math.round((scrolled + 0.001) * 10 / (this.toScroll + 0.001)) * 10,
i,
box;
for (i = 0; i < this.boxes_wait_for_scroll.length; i++) {
box = this.boxes_wait_for_scroll[i];
if ((box.trigger.action === ‘scroll’ || box.trigger.action === ‘element’) && rate >= box.trigger.scroll && box.hidden && !box.closed) {
if (box.trigger.delaytime > 0) {
this.regTimedOpening(box, box.trigger.delaytime);
} else {
this.showBox(box, false);
}
}
if ((box.trigger.action === ‘scroll’ || box.trigger.action === ‘element’) && rate < box.trigger.scroll && !box.hidden) {
this.hideBox(box);
}
}
};
Another solution could be to change the type of the box once we know the wanted scroll rate :
if (box.trigger.action === ‘element’) {
if (jQuery(box.trigger.element).length > 0) {
elementheight = jQuery(box.trigger.element).offset().top;
this.toScroll = this.docheight – this.screenheight;
box.trigger.scroll = ((elementheight – this.screenheight) + 0.001) / (this.toScroll + 0.001) * 100;
box.trigger.action = ‘scroll’;
} else {
box.trigger.scroll = 111;
this.echo(‘Element ‘ + box.trigger.element + ‘ is missing’);
}
}