lightBox (overlay) init pause autoSlide#4
lightBox (overlay) init pause autoSlide#4needle2k wants to merge 3 commits intoberlinmagic:masterfrom
Conversation
added observer for lightBox overlay to prevent autoSlide false, if lightbox is initialized // Selector to be observed lightBoxOpenSelector: "lbOverlay", // lightbox overlay div // enable/ disable observe observeLightBoxOpen: false,
|
give me an example, because I think there is always more than 1 overlay .. dialog / modal / dropdown / etc attrchange.js looks great! but do you realy think its needed, when that if-clause happens it should always get the actual state of the given overlay, so for what the extra listener ?? |
|
to observe the overlay init each time e.g you click on the image, since slider get´s init only once, e.g. slimbox2.js has overlay id="lbOverlay" <div id="lbOverlay" style="opacity: 0.8; display: none;"></div> // base overlayThe listener fetches the change of the defined lightBoxOpenSelector style attribute // observe lightbox init to pause autoSlide
if (settings.observeLightBoxOpen === true) {
$('#' + settings.lightBoxOpenSelector).attrchange(function(attrName) {
var currentDisplay = $('#' + settings.lightBoxOpenSelector).css('display');
if ( currentDisplay === 'block') {
mouseEvent = true;
} else {
mouseEvent = false;
}
});
}similar to the mouseenter / mouseleave listener take a look here btw, is that normal that it rewinds all to restart slide process ? i thought it does it without rewind (carousel mode) |
|
OK I got your point .. but I still think that is no common scenario, whats about an external pause-trigger ? so your lightbox could send pause on open and play on close Sorry .. I'm a bit against listener like that .. because it is a needless dependency .. or better you can also fix it without .. dont get me wrong attrchange.js looks good and fast, but it isn't needed |
Added lightBox obeserver to pause autoSlide
Added attrchange.js to js tree code by http://meetselva.github.io/ great work m8 !
works with all latest browser Chrome,FF,IE