diff --git a/assets/jquery.alton.js b/assets/jquery.alton.js index c7b0d85..67a7818 100644 --- a/assets/jquery.alton.js +++ b/assets/jquery.alton.js @@ -316,14 +316,18 @@ top = false; } }); - slideIndex(current, false); - } else { - if (last !== $('.' + singleSlideClass + ':last-child')[0]) { - slideNumbersFade(false); - } else { - slideNumbersFade(true); + if (settings.useSlideNumbers) { slideIndex(current, false); } + } else { + if (settings.useSlideNumbers) { + if (last !== $('.' + singleSlideClass + ':last-child')[0]) { + slideNumbersFade(false); + } else { + slideNumbersFade(true); + slideIndex(current, false); + } + } $(document).scrollTo(current); } } diff --git a/assets/jquery.alton.min.js b/assets/jquery.alton.min.js index c7b018f..c7533a9 100644 --- a/assets/jquery.alton.min.js +++ b/assets/jquery.alton.min.js @@ -20,4 +20,4 @@ * - https://github.com/peachananr/onepage-scroll * * License: GPL v3 - * =============================================================================== */(function(e){"use strict";var t={firstClass:"header",fullSlideContainer:"full",singleSlideClass:"slide",nextElement:"div",previousClass:null,lastClass:"footer",slideNumbersContainer:"slide-numbers",bodyContainer:"pageWrapper",scrollMode:"featuredScroll",useSlideNumbers:!1,slideNumbersBorderColor:"#fff",slideNumbersColor:"#000",animationType:"slow"};e.fn.alton=function(n){function x(t){if(t==="featuredScroll"){for(S=s.length-1;S>=0;S-=1){e(s[S]).css("height",y);e(s[S]).outerHeight(y)}if(r.useSlideNumbers&&!N()){e("."+r.bodyContainer).append('
');e("#"+r.slideNumbersContainer).css({height:"100%",position:"fixed",top:0,right:"0px",bottom:"0px",width:"86px","z-index":999});e("."+r.bodyContainer+" #"+r.slideNumbersContainer).append("');T()?e(".paginate").css({cursor:"pointer","border-radius":"50%","list-style":"none",background:r.slideNumbersBorderColor,"border-color":r.slideNumbersBorderColor,"border-width":"2px","border-style":"solid",height:"11px",width:"11px",margin:"5px 0"}):e(".paginate").css({cursor:"pointer","border-radius":"50%","list-style":"none",background:r.slideNumbersBorderColor,"border-color":r.slideNumbersBorderColor,"border-width":"2px","border-style":"solid",height:"10px",width:"10px",margin:"5px 0"});n+=1}"getElementsByClassName"in document?d=document.getElementsByClassName("paginate"):d=document.querySelectorAll(".paginate")}}else{e("."+r.firstClass).css("height",y+10);if(!e("."+r.firstClass).hasClass("active")){e("."+r.firstClass).toggleClass("active");T()&&e(".paginate.active").css({"margin-left":"-1px","border-color":"#"+r.slideNumbersBorderColor,"border-style":"solid","border-width":"2px",height:"8px",width:"8px"})}}}function T(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");return t>0||navigator.userAgent.match(/Trident.*rv\:11\./)?!0:!1}function N(){return navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry|BB10|Windows Phone|Tizen|Bada)/)}function C(t,n){if(n&&e(d[e(t).parent().children().index(t)]).hasClass("active")){e(d[e(t).parent().children().index(t)]).toggleClass("active");e(d[e(t).parent().children().index(t)]).css("background",r.slideNumbersBorderColor)}else{e(d[e(t).parent().children().index(t)]).toggleClass("active");e(d[e(t).parent().children().index(t)]).css("background",r.slideNumbersColor)}}function k(t){r.useSlideNumbers&&(t?e("#"+r.slideNumbersContainer).fadeIn():e("#"+r.slideNumbersContainer).fadeOut())}function L(t){var n=document.getElementsByClassName(i);e(document).scrollTo(e(n[t]));f=n[t];e(f).prev().hasClass(i)?c=e(f).prev():c=e("."+r.firstClass);e(f).next().hasClass(i)?l=e(f).next():l=e("."+r.lastClass);C(e("#"+r.slideNumbersContainer+" li.active"),!0);C(n[t],!1)}function A(){if(e(window).scrollTop()>=l.offset().top&&e(window).scrollTop()+e(window).outerHeight()!==e(document).outerHeight()){var t;e("."+i).each(function(){t=e(this).offset().top;if(t<=e(window).scrollTop()){e(this).prev().hasClass(i)?c=e(this).prev():c=e("."+r.firstClass);f=e(this);f.next().hasClass(i)?l=e(this).next():l=e("."+r.lastClass);v=!1}});C(f,!1)}else{if(h!==e("."+i+":last-child")[0])k(!1);else{k(!0);C(f,!1)}e(document).scrollTo(f)}}function O(e){e=e||window.event;if(e.preventDefault){e.stopPropagation();e.returnValue=!1}}function M(e){return O(e)}function _(){return window.pageYOffset||w.scrollTop}function D(t){o=e("body,html").is(":animated")||e("body").is(":animated")||e("html").is(":animated");clearTimeout(e.data(this,"scrollTimer"));e.data(this,"scrollTimer",setTimeout(function(){b=!1},35));if(t.originalEvent.detail>1&&!b||t.originalEvent.wheelDelta<-1&&!b){g+=1;e(document).moveDown();b=!0;O()}else if(t.originalEvent.detail<-1&&!b||t.originalEvent.wheelDelta>1&&!b){m+=1;e(document).moveUp();b=!0;O()}return!1}function P(t){E=_();if(t.originalEvent.detail>0||t.originalEvent.wheelDelta<0){if(!(e(l).offset().top>0&&E ');T()?e(".paginate").css({cursor:"pointer","border-radius":"50%","list-style":"none",background:r.slideNumbersBorderColor,"border-color":r.slideNumbersBorderColor,"border-width":"2px","border-style":"solid",height:"11px",width:"11px",margin:"5px 0"}):e(".paginate").css({cursor:"pointer","border-radius":"50%","list-style":"none",background:r.slideNumbersBorderColor,"border-color":r.slideNumbersBorderColor,"border-width":"2px","border-style":"solid",height:"10px",width:"10px",margin:"5px 0"});n+=1}"getElementsByClassName"in document?d=document.getElementsByClassName("paginate"):d=document.querySelectorAll(".paginate")}}else{e("."+r.firstClass).css("height",y+10);if(!e("."+r.firstClass).hasClass("active")){e("."+r.firstClass).toggleClass("active");T()&&e(".paginate.active").css({"margin-left":"-1px","border-color":"#"+r.slideNumbersBorderColor,"border-style":"solid","border-width":"2px",height:"8px",width:"8px"})}}}function T(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");return t>0||navigator.userAgent.match(/Trident.*rv\:11\./)?!0:!1}function N(){return navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry|BB10|Windows Phone|Tizen|Bada)/)}function C(t,n){if(n&&e(d[e(t).parent().children().index(t)]).hasClass("active")){e(d[e(t).parent().children().index(t)]).toggleClass("active");e(d[e(t).parent().children().index(t)]).css("background",r.slideNumbersBorderColor)}else{e(d[e(t).parent().children().index(t)]).toggleClass("active");e(d[e(t).parent().children().index(t)]).css("background",r.slideNumbersColor)}}function k(t){r.useSlideNumbers&&(t?e("#"+r.slideNumbersContainer).fadeIn():e("#"+r.slideNumbersContainer).fadeOut())}function L(t){var n=document.getElementsByClassName(i);e(document).scrollTo(e(n[t]));f=n[t];e(f).prev().hasClass(i)?c=e(f).prev():c=e("."+r.firstClass);e(f).next().hasClass(i)?l=e(f).next():l=e("."+r.lastClass);C(e("#"+r.slideNumbersContainer+" li.active"),!0);C(n[t],!1)}function A(){if(e(window).scrollTop()>=l.offset().top&&e(window).scrollTop()+e(window).outerHeight()!==e(document).outerHeight()){var t;e("."+i).each(function(){t=e(this).offset().top;if(t<=e(window).scrollTop()){e(this).prev().hasClass(i)?c=e(this).prev():c=e("."+r.firstClass);f=e(this);f.next().hasClass(i)?l=e(this).next():l=e("."+r.lastClass);v=!1}});r.useSlideNumbers&&C(f,!1)}else{if(r.useSlideNumbers)if(h!==e("."+i+":last-child")[0])k(!1);else{k(!0);C(f,!1)}e(document).scrollTo(f)}}function O(e){e=e||window.event;if(e.preventDefault){e.stopPropagation();e.returnValue=!1}}function M(e){return O(e)}function _(){return window.pageYOffset||w.scrollTop}function D(t){o=e("body,html").is(":animated")||e("body").is(":animated")||e("html").is(":animated");clearTimeout(e.data(this,"scrollTimer"));e.data(this,"scrollTimer",setTimeout(function(){b=!1},35));if(t.originalEvent.detail>1&&!b||t.originalEvent.wheelDelta<-1&&!b){g+=1;e(document).moveDown();b=!0;O()}else if(t.originalEvent.detail<-1&&!b||t.originalEvent.wheelDelta>1&&!b){m+=1;e(document).moveUp();b=!0;O()}return!1}function P(t){E=_();if(t.originalEvent.detail>0||t.originalEvent.wheelDelta<0){if(!(e(l).offset().top>0&&E");e("."+r.bodyContainer+" #"+r.slideNumbersContainer+" ul").css({transform:"translateY(-50%)","-moz-transform":"translateY(-50%)","-ms-transform":"translateY(-50%)","-o-transform":"translateY(-50%)","-webkit-transform":"translateY(-50%)",top:"50%",position:"fixed"});var n=0;while(n