Fail on reusing overlay in slideshow
Posted: Fri Sep 11, 2015 11:47 am
Hello! I cretae overlay like this
running onBeforeExpand event like mentioned in reference.
On the first element of slideshow this overlay appears, at the next when highslide must reuse overlay it doesn't. At the third it appears again I think because there is already no given overlay on hs.expande.last object/ Please help me fix this problem.
Code: Select all
try{
if($(sender.a).closest('.b_card-cnt').length>0 || (sender.slideshowGroup && sender.slideshowGroup.indexOf('product_')===0)){
var html,ja,a;
if($(sender.a).closest('.b_card-cnt').length>0){
html = $(sender.a).closest('.b_card-cnt').find('.b_btn').get(0).outerHTML;
}
else{
//alert('3');
ja = $('[data-id='+$(sender.a).parent().data('prod-id')+']');
if(ja.closest('article').length>0){
html = ja.closest('article').find('.order').get(0).outerHTML;
}
else if(ja.closest('.row').length>0){
a = ja.closest('.row').find('.orderTable').clone();
a.removeClass('ordeTable').addClass('order');
a.find('i').remove();
html = a.get(0).outerHTML;
}
}
if($('.overlay_order').length==0){
$('body').append('<div id="overlay_order" class="overlay_order highslide-overlay" style="display: none"></div>');
}
//$('.overlay_order').html(html);
sender.createOverlay( {overlayId: 'overlay_order', position: "bottom right",
hideOnMouseOut: false,html: html} );
}
} catch(e){alert(e)}
On the first element of slideshow this overlay appears, at the next when highslide must reuse overlay it doesn't. At the third it appears again I think because there is already no given overlay on hs.expande.last object/ Please help me fix this problem.