Plugin Directory

Changeset 1600584


Ignore:
Timestamp:
02/21/2017 12:55:59 PM (9 years ago)
Author:
skoldin
Message:

Fix the previous commit

Location:
click-to-scroll/trunk/assets/js
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • click-to-scroll/trunk/assets/js/front.js

    r1600311 r1600584  
    2626                    $elem = $(selector);
    2727
     28
    2829                // if the URL contains not only hash, check if we are on the same page
    29                 if( location !== unhashedUrl && unhashedLocation !== unhashedUrl ) {
     30                if( (unhashedUrl) && (location !== unhashedUrl && unhashedLocation !== unhashedUrl) ) {
    3031                    return;
    3132                }
  • click-to-scroll/trunk/assets/js/front.min.js

    r1600311 r1600584  
    11(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);
     2f=a(f);b&&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);
Note: See TracChangeset for help on using the changeset viewer.