0
My problem is this, I am using the plugin scrollTo
was all ok working on all elements I wanted on the site.
However they asked to change something in the menu, currently the effect only happens when I click on the tag <a href="#">
, however asked to change, now everything has to happen when I click on <li>
. Okay could involve the li
within a a
, but I would have a bigger job (I believe) than changing the JS
, but not getting it, I already modified the code below a few times and it only worked when in html
I put the href
on the tag li
(but it must be wrong this right).
Follows the code.
$(function(){
var wrapper = $("#wrapper"),
$menu = $("#menu");
$menu.on("click","a", function(){
var $this = $(this),
href = $(this).attr("href"),
topY = $(href).offset().top;
TweenLite.to(window, 2, {scrollTo:{y:topY, x:0}, ease:Cubic.easeIn});
return false;
});
});
nav#menu.menu
ul
li.icon-play
a(href="#home")
li.link-empresa
a(href="#empresa") playlearn
li.link-tecnologias
a(href="#tecnologicas") tecnologia educacional
li.link-cases
a(href="#cases") portifólio
li.link-contato
a(href="#contato") contato
Guy was just that, very basic and I was cracking my head =/ ... Thank you so much =D.
– user27585
@Erick is not shaken that I have been for almost a decade breaking my head in the JS hahaha besides we are here to strengthen the community, I am happy to help you!
– Thiago Santos