Changeset 1491558
- Timestamp:
- 09/07/2016 06:37:29 AM (10 years ago)
- File:
-
- 1 edited
-
click-to-scroll/trunk/assets/js/front.min.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
click-to-scroll/trunk/assets/js/front.min.js
r1484571 r1491558 1 (function(a){var c=a(".js_settings").val(),d=a(".cts-button"), c=c?JSON.parse(c):null;a(window).load(function(){d.on("click",function(b){b.preventDefault();a("html, body").animate({scrollTop:0},400,"linear")});if(c&&"1"===c.scroll_to_anchor)a('a[href^="#"]').not('a[href="#"]').on("click",function(b){b.preventDefault();b=a(this).attr("href");var e=a(b);if(e.length){b=e.offset().top;var d=a("#wpadminbar");d.length&&"fixed"===d.css("position")&&(b-=d.height());c.global_offset&&(b-=parseInt(c.global_offset));2 (e=e.data("offset"))&&(b-=parseInt(e));a("html, body").animate({scrollTop:b},400,"linear")}})});a(window).on("scroll",function(){var b=a(window).height()/2;a("body").scrollTop()>b?d.addClass("active"):d.removeClass("active")})})(jQuery);1 (function(a){var c=a(".js_settings").val(),d=a(".cts-button"),f=(c=c?JSON.parse(c):null)&&c.animation_speed?parseInt(c.animation_speed):400;a(window).load(function(){d.on("click",function(b){b.preventDefault();a("html, body").animate({scrollTop:0},f,"linear")});if(c&&"1"===c.scroll_to_anchor)a('a[href^="#"]').not('a[href="#"]').on("click",function(b){b.preventDefault();b=a(this).attr("href");var e=a(b);if(e.length){b=e.offset().top;var d=a("#wpadminbar");d.length&&"fixed"===d.css("position")&&(b-= 2 d.height());c.global_offset&&(b-=parseInt(c.global_offset));(e=e.data("offset"))&&(b-=parseInt(e));a("html, body").animate({scrollTop:b},f,"linear")}})});a(window).on("scroll",function(){var b=a(window).height()/2;a("body").scrollTop()>b?d.addClass("active"):d.removeClass("active")})})(jQuery);
Note: See TracChangeset
for help on using the changeset viewer.