Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- const reviewsBlockId = "#reviews-block";
- const isPageHaveReviewsBlock = $(reviewsBlockId).length > 0;
- const reviewsLink = $(`a[href="/otzyvy/"]`);
- const reviewsBlockPosition = $(reviewsBlockId).eq(0).offset().top;
- reviewsLink.on("click", function(e) {
- if (isPageHaveReviewsBlock) {
- e.preventDefault();
- $("html, body").animate({
- scrollTop: reviewsBlockPosition
- }, 1000);
- } else {
- return true
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment