|
emptyindorill,
я пас ... |
Получилось!
function scroll_to_elem(selector) { jQuery(selector).on('click', function (e) { e.preventDefault(); var scroll_el = jQuery(this).attr('href'); scroll_el = scroll_el.replace(/_/g, ''); if (jQuery(scroll_el).length != 0) { jQuery('html, body').animate({scrollTop: jQuery(scroll_el).offset().top}, 500); } return false; }); } function scroll_to_hash() { jQuery('html, body').animate({scrollTop: jQuery('#anchor').offset().top}, 500); } jQuery(window).load(function () { scroll_to_hash(); scroll_to_elem("[href^='#_']"); }); |
Часовой пояс GMT +3, время: 13:50. |