Changeset 1600311
- Timestamp:
- 02/21/2017 05:54:18 AM (9 years ago)
- Location:
- click-to-scroll/trunk
- Files:
-
- 3 edited
-
assets/js/front.js (modified) (1 diff)
-
assets/js/front.min.js (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
click-to-scroll/trunk/assets/js/front.js
r1600288 r1600311 19 19 if ( jsSettings && +jsSettings.scroll_to_anchor === 1) { 20 20 $('a[href*="#"]').not('a[href="#"]').not('a[href$="#"]').on('click', function (e) { 21 e.preventDefault();22 23 21 var url = $(this).attr('href'), 24 22 selector = url.slice(url.indexOf('#')), 23 unhashedUrl = url.slice(0, url.indexOf('#')), 24 location = document.location.href, 25 unhashedLocation = location.slice(0, location.indexOf('#')), 25 26 $elem = $(selector); 27 28 // if the URL contains not only hash, check if we are on the same page 29 if( location !== unhashedUrl && unhashedLocation !== unhashedUrl ) { 30 return; 31 } 32 33 e.preventDefault(); 26 34 27 35 if( $elem.length ) { -
click-to-scroll/trunk/assets/js/front.min.js
r1600288 r1600311 1 (function( b){var c=b(".js_settings").val(),d=b(".cts-button"),f=(c=c?JSON.parse(c):null)&&c.animation_speed?parseInt(c.animation_speed):400;b(window).load(function(){d.on("click",function(a){a.preventDefault();b("html, body").animate({scrollTop:0},f,"linear")});if(c&&1===+c.scroll_to_anchor)b('a[href*="#"]').not('a[href="#"]').not('a[href$="#"]').on("click",function(a){a.preventDefault();a=b(this).attr("href");a=a.slice(a.indexOf("#"));var e=b(a);if(e.length){a=e.offset().top;var d=b("#wpadminbar");2 d.length&&"fixed"===d.css("position")&&(a-=d.height());c.global_offset&&(a-=parseInt(c.global_offset));(e=e.data("offset"))&&(a-=parseInt(e));b("html, body").animate({scrollTop:a},f,"linear")}})});b(window).on("scroll",function(){var a=b(window).height()/2;b("body").scrollTop()>a?d.addClass("active"):d.removeClass("active")})})(jQuery);1 (function(a){var d=a(".js_settings").val(),e=a(".cts-button"),g=(d=d?JSON.parse(d):null)&&d.animation_speed?parseInt(d.animation_speed):400;a(window).load(function(){e.on("click",function(c){c.preventDefault();a("html, body").animate({scrollTop:0},g,"linear")});if(d&&1===+d.scroll_to_anchor)a('a[href*="#"]').not('a[href="#"]').not('a[href$="#"]').on("click",function(c){var b=a(this).attr("href"),f=b.slice(b.indexOf("#")),b=b.slice(0,b.indexOf("#")),e=document.location.href,h=e.slice(0,e.indexOf("#")), 2 f=a(f);if(e===b||h===b)c.preventDefault(),f.length&&(c=f.offset().top,b=a("#wpadminbar"),b.length&&"fixed"===b.css("position")&&(c-=b.height()),d.global_offset&&(c-=parseInt(d.global_offset)),(f=f.data("offset"))&&(c-=parseInt(f)),a("html, body").animate({scrollTop:c},g,"linear"))})});a(window).on("scroll",function(){var c=a(window).height()/2;a("body").scrollTop()>c?e.addClass("active"):e.removeClass("active")})})(jQuery); -
click-to-scroll/trunk/readme.txt
r1600288 r1600311 61 61 == Changelog == 62 62 63 = 1.3. 1=63 = 1.3.2 = 64 64 * Fix: enabled scroll anchor option might be ignored 65 65 * Fix: scroll to anchor even if the URL contains not only hash
Note: See TracChangeset
for help on using the changeset viewer.