Lines Matching full:lg
1 /*! lg-zoom - v1.0.4 - 2016-12-20
66 …var zoomIcons = '<span id="lg-zoom-in" class="lg-icon"></span><span id="lg-zoom-out" class="lg-ico…
69 zoomIcons += '<span id="lg-actual-size" class="lg-icon"></span>';
73 _this.core.$outer.addClass('lg-use-left-for-zoom');
75 _this.core.$outer.addClass('lg-use-transition-for-zoom');
78 this.core.$outer.find('.lg-toolbar').append(zoomIcons);
81 _this.core.$el.on('onSlideItemLoad.lg.tm.zoom', function(event, index, delay) {
87 if ($('body').hasClass('lg-from-hash') && delay) {
93 // Remove lg-from-hash to enable starting animation.
94 $('body').removeClass('lg-from-hash');
98 _this.core.$slide.eq(index).addClass('lg-zoomable');
111 var $image = _this.core.$outer.find('.lg-current .lg-image');
139 _this.core.$outer.addClass('lg-zoomed');
162 if (_this.core.$outer.hasClass('lg-zoomed')) {
181 _this.core.$outer.removeClass('lg-grabbing').addClass('lg-grab');
188 _this.core.$el.on('onAferAppendSlide.lg.tm.zoom', function(event, index) {
191 var $image = _this.core.$slide.eq(index).find('.lg-image');
214 $(window).on('resize.lg.zoom scroll.lg.zoom orientationchange.lg.zoom', function() {
220 $('#lg-zoom-out').on('click.lg', function() {
221 if (_this.core.$outer.find('.lg-current .lg-image').length) {
227 $('#lg-zoom-in').on('click.lg', function() {
228 if (_this.core.$outer.find('.lg-current .lg-image').length) {
234 $('#lg-actual-size').on('click.lg', function(event) {
235 …actualSize(event, _this.core.$slide.eq(_this.core.index).find('.lg-image'), _this.core.index, true…
239 _this.core.$el.on('onBeforeSlide.lg.tm', function() {
257 this.core.$outer.removeClass('lg-zoomed');
258 this.core.$slide.find('.lg-img-wrap').removeAttr('style data-x data-y');
259 this.core.$slide.find('.lg-image').removeAttr('style data-scale');
278 _this.core.$slide.on('touchstart.lg', function(e) {
280 if (_this.core.$outer.hasClass('lg-zoomed')) {
281 var $image = _this.core.$slide.eq(_this.core.index).find('.lg-object');
283 …= $image.prop('offsetHeight') * $image.attr('data-scale') > _this.core.$outer.find('.lg').height();
284 …X = $image.prop('offsetWidth') * $image.attr('data-scale') > _this.core.$outer.find('.lg').width();
296 _this.core.$slide.on('touchmove.lg', function(e) {
298 if (_this.core.$outer.hasClass('lg-zoomed')) {
300 var _$el = _this.core.$slide.eq(_this.core.index).find('.lg-img-wrap');
313 _this.core.$outer.addClass('lg-zoom-dragging');
343 _this.core.$slide.on('touchend.lg', function() {
344 if (_this.core.$outer.hasClass('lg-zoomed')) {
347 _this.core.$outer.removeClass('lg-zoom-dragging');
370 _this.core.$slide.on('mousedown.lg.zoom', function(e) {
372 // execute only on .lg-object
373 var $image = _this.core.$slide.eq(_this.core.index).find('.lg-object');
375 …= $image.prop('offsetHeight') * $image.attr('data-scale') > _this.core.$outer.find('.lg').height();
376 …X = $image.prop('offsetWidth') * $image.attr('data-scale') > _this.core.$outer.find('.lg').width();
378 if (_this.core.$outer.hasClass('lg-zoomed')) {
379 if ($(e.target).hasClass('lg-object') && (allowX || allowY)) {
392 _this.core.$outer.removeClass('lg-grab').addClass('lg-grabbing');
397 $(window).on('mousemove.lg.zoom', function(e) {
399 var _$el = _this.core.$slide.eq(_this.core.index).find('.lg-img-wrap');
410 _this.core.$outer.addClass('lg-zoom-dragging');
435 $(window).on('mouseup.lg.zoom', function(e) {
439 _this.core.$outer.removeClass('lg-zoom-dragging');
454 _this.core.$outer.removeClass('lg-grabbing').addClass('lg-grab');
462 var _$el = _this.core.$slide.eq(_this.core.index).find('.lg-img-wrap');
463 var $image = _this.core.$slide.eq(_this.core.index).find('.lg-object');
466 var minY = (_this.core.$outer.find('.lg').height() - $image.prop('offsetHeight')) / 2;
467 …etHeight') * Math.abs($image.attr('data-scale'))) - _this.core.$outer.find('.lg').height() + minY);
468 var minX = (_this.core.$outer.find('.lg').width() - $image.prop('offsetWidth')) / 2;
469 …fsetWidth') * Math.abs($image.attr('data-scale'))) - _this.core.$outer.find('.lg').width() + minX);
517 _this.core.$el.off('.lg.zoom');
518 $(window).off('.lg.zoom');
519 _this.core.$slide.off('.lg.zoom');
520 _this.core.$el.off('.lg.tm.zoom');