Skip to content

Commit 69e9936

Browse files
committed
ピンチアウトの動作検証
1 parent 0646b08 commit 69e9936

File tree

3 files changed

+15
-43
lines changed

3 files changed

+15
-43
lines changed

dist/js/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/jquery-isystkSlider.js

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -655,20 +655,15 @@
655655
// ピンチアウトでリサイズした画像を元の状態に戻す。
656656
var resetImage = this.resetImage = function() {
657657

658-
ul.find('.childKey').each(function() {
658+
ul.find(childKey).each(function() {
659659

660660
var target = $(this),
661661
img = target.find('img');
662662

663-
// 動画は対象外
664-
if (target.find('.targetMovie').length !== 0) {
665-
return;
666-
}
667-
668663
img.css('position', '');
669664
img.css('top', '');
670665
img.css('left', '');
671-
img.closest('.childKey').css('text-align', 'center');
666+
img.closest(childKey).css('text-align', 'center');
672667

673668
img.css({
674669
'transform-origin': '',
@@ -709,7 +704,7 @@
709704

710705
this.init = function() {
711706

712-
ul.find('.childKey').each(function() {
707+
ul.find(childKey).each(function() {
713708

714709
var target = $(this),
715710
img = target.find('img'),
@@ -727,9 +722,6 @@
727722
return;
728723
}
729724

730-
// デバック用 TODO 何故かCloneしたLIには表示されない。
731-
// target.append( $('<div class="debugText">☆</div>').css('position', 'relative').css('background-color', '#ffffff').css('width', '100px'));
732-
733725
target.css('overflow', 'hidden');
734726
var touchstart_bar = 0;
735727
var multiTap = false; // 指2本でタップしているかどうか
@@ -772,7 +764,7 @@
772764
img.css('position', 'fixed');
773765
img.css('top', (($(window).height() - initHeight) / 2) + 'px');
774766
img.css('left', (($(window).width() - initWidth) / 2) + 'px');
775-
img.closest('.childKey').css('text-align', '');
767+
img.closest(childKey).css('text-align', '');
776768

777769
if (1 < zoom) {
778770
moveX=0;
@@ -797,7 +789,7 @@
797789
img.css('position', '');
798790
img.css('top', '');
799791
img.css('left', '');
800-
img.closest('.childKey').css('text-align', 'center');
792+
img.closest(childKey).css('text-align', 'center');
801793
}, 150 ) ;
802794
}
803795

@@ -818,7 +810,7 @@
818810
img.css('position', 'fixed');
819811
img.css('top', (($(window).height() - initHeight) / 2) + 'px');
820812
img.css('left', (($(window).width() - initWidth) / 2) + 'px');
821-
img.closest('.childKey').css('text-align', '');
813+
img.closest(childKey).css('text-align', '');
822814

823815
multiTap = true;
824816
pinchOutLoading = true;
@@ -879,11 +871,7 @@
879871
'-moz-transform-origin': posPerX + '% ' + posPerY + '%',
880872
'-ms-transform-origin': posPerX + '% ' + posPerY + '%'
881873
});
882-
883-
// target.find('.debugText').text('posPerX:' + posPerX + '/posPerY:' + posPerY);
884-
885874
}
886-
887875
}
888876

889877
pageX1= e.touches[0].pageX;
@@ -896,7 +884,6 @@
896884
},false);
897885
}
898886

899-
900887
if (!target.hasClass('bind_touchmove')) {
901888
target.addClass('bind_touchmove');
902889

@@ -910,7 +897,6 @@
910897
if(!multiTap){
911898

912899
//1本指だったら移動
913-
914900
var x = (pageX1 - e.touches[0].pageX);
915901
var y = (pageY1 - e.touches[0].pageY);
916902

@@ -1137,7 +1123,7 @@
11371123
img.css('position', '');
11381124
img.css('top', '');
11391125
img.css('left', '');
1140-
img.closest('.childKey').css('text-align', 'center');
1126+
img.closest(childKey).css('text-align', 'center');
11411127
pinchOutLoading = false;
11421128
}, 150 ) ;
11431129
}

src/assets/js/jquery-isystkSlider.js

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -655,20 +655,15 @@
655655
// ピンチアウトでリサイズした画像を元の状態に戻す。
656656
var resetImage = this.resetImage = function() {
657657

658-
ul.find('.childKey').each(function() {
658+
ul.find(childKey).each(function() {
659659

660660
var target = $(this),
661661
img = target.find('img');
662662

663-
// 動画は対象外
664-
if (target.find('.targetMovie').length !== 0) {
665-
return;
666-
}
667-
668663
img.css('position', '');
669664
img.css('top', '');
670665
img.css('left', '');
671-
img.closest('.childKey').css('text-align', 'center');
666+
img.closest(childKey).css('text-align', 'center');
672667

673668
img.css({
674669
'transform-origin': '',
@@ -709,7 +704,7 @@
709704

710705
this.init = function() {
711706

712-
ul.find('.childKey').each(function() {
707+
ul.find(childKey).each(function() {
713708

714709
var target = $(this),
715710
img = target.find('img'),
@@ -727,9 +722,6 @@
727722
return;
728723
}
729724

730-
// デバック用 TODO 何故かCloneしたLIには表示されない。
731-
// target.append( $('<div class="debugText">☆</div>').css('position', 'relative').css('background-color', '#ffffff').css('width', '100px'));
732-
733725
target.css('overflow', 'hidden');
734726
var touchstart_bar = 0;
735727
var multiTap = false; // 指2本でタップしているかどうか
@@ -772,7 +764,7 @@
772764
img.css('position', 'fixed');
773765
img.css('top', (($(window).height() - initHeight) / 2) + 'px');
774766
img.css('left', (($(window).width() - initWidth) / 2) + 'px');
775-
img.closest('.childKey').css('text-align', '');
767+
img.closest(childKey).css('text-align', '');
776768

777769
if (1 < zoom) {
778770
moveX=0;
@@ -797,7 +789,7 @@
797789
img.css('position', '');
798790
img.css('top', '');
799791
img.css('left', '');
800-
img.closest('.childKey').css('text-align', 'center');
792+
img.closest(childKey).css('text-align', 'center');
801793
}, 150 ) ;
802794
}
803795

@@ -818,7 +810,7 @@
818810
img.css('position', 'fixed');
819811
img.css('top', (($(window).height() - initHeight) / 2) + 'px');
820812
img.css('left', (($(window).width() - initWidth) / 2) + 'px');
821-
img.closest('.childKey').css('text-align', '');
813+
img.closest(childKey).css('text-align', '');
822814

823815
multiTap = true;
824816
pinchOutLoading = true;
@@ -879,11 +871,7 @@
879871
'-moz-transform-origin': posPerX + '% ' + posPerY + '%',
880872
'-ms-transform-origin': posPerX + '% ' + posPerY + '%'
881873
});
882-
883-
// target.find('.debugText').text('posPerX:' + posPerX + '/posPerY:' + posPerY);
884-
885874
}
886-
887875
}
888876

889877
pageX1= e.touches[0].pageX;
@@ -896,7 +884,6 @@
896884
},false);
897885
}
898886

899-
900887
if (!target.hasClass('bind_touchmove')) {
901888
target.addClass('bind_touchmove');
902889

@@ -910,7 +897,6 @@
910897
if(!multiTap){
911898

912899
//1本指だったら移動
913-
914900
var x = (pageX1 - e.touches[0].pageX);
915901
var y = (pageY1 - e.touches[0].pageY);
916902

@@ -1137,7 +1123,7 @@
11371123
img.css('position', '');
11381124
img.css('top', '');
11391125
img.css('left', '');
1140-
img.closest('.childKey').css('text-align', 'center');
1126+
img.closest(childKey).css('text-align', 'center');
11411127
pinchOutLoading = false;
11421128
}, 150 ) ;
11431129
}

0 commit comments

Comments
 (0)