JoomShaper / Helix3

46 stars 37 forks source link

smooth scroll to the section (sp page builder + helix3) version 2 #76

Closed epson950 closed 7 years ago

epson950 commented 7 years ago

I made everything as in the instruction for exile, but in new helix 3 v2.1 it doesn't work, help! and the second question, such scrolling not from the menu, and from the button is necessary how to make?

epson950 commented 7 years ago

itself found the solution jQuery(function() { //В следующей выборке так же просто можно прописать привязку на любой элемент //Сейчас "якорь" определяется по наличию символа # в ссылке jQuery('a[href*="#"]').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname){ var target = jQuery(this.hash);target = target.length ? target : jQuery('[name=' + this.hash.slice(1) +']'); if (target.length) { var scrl = target.offset().top; //Получаем отступ от верхнего края var offset = 70; //Отступ от элемента в пикселях var speed = 1000; //Скорость прокрутки scrl = scrl - offset; jQuery('html, body').animate({ scrollTop: scrl }, speed); return false; } } }); });

author

epson950 commented 7 years ago
  1. we place this code in the anchor-smooth-scroll.js file
  2. we place the anchor-smooth-scroll.js file in the folder with scripts of your template (by me ***/templates/shaper_helix3/js)
  3. in the folder ***/templates/shaper_helix3 we look for the index.php file and we look for a code // load CSS, less and js jquery.nav.js, smoothscroll.js, $this->helix3->addCSS('bootstrap.min.css, font-awesome.min.css') // CSS Files ->addJS('bootstrap.min.js, jquery.sticky.js, main.js') // JS Files also we add to it loading of the necessary script // load CSS, less and js jquery.nav.js, smoothscroll.js, $this->helix3->addCSS('bootstrap.min.css, font-awesome.min.css') // CSS Files ->addJS('bootstrap.min.js, jquery.sticky.js, anchor-smooth-scroll.js, main.js') // JS Files
samuelmf commented 7 years ago

Where i can download the complete set of files to make work the smoothscroll on the v2.1 of helix 3?

What files i need? Thanks

alebak commented 7 years ago

Smooth scroll scripts is loses every on each update the Helix 3 template. The JoomShaper team should add a boolean parameter like as the 'Preloader' or 'Go To Top' or 'Sticky Header' options in the Basic tab from Helix 3 template.