Hello All,
I am using latest version of Tweenlite and Tweenmax library but scroll-to parameters are not working.I am calling element id in Y parameter and offsetY with numbers but both are not working also no any errors prompted in console.
Please suggest whats else over there below is code which I am using ->
TweenLite.to(window, 2, {scrollTo:{y: div_id, offsetY:50000}});
TweenMax.to(window, 2, {scrollTo:{y: div_id, offsetY:50000}});
div_id not working
Offsety: not working
complete code snippets->
var anchor_nav = document.querySelector('.snap__subnav');
anchor_nav.addEventListener('click', function(e) {
var target = e.target,
href = target.getAttribute('href');
id = target.getAttribute('id');
div_id1=href.replace("subnav_","subnav_anchor_");
div_id=div_id1.replace("#",'.')+'_widget';
if(href !== null && id !== null) {
if(href.length > 0) {
e.preventDefault();
callTrigger(href,div_id);
e.preventDefault();
if(window.history && window.history.pushState) {
history.pushState("", document.title, href);
}
}
}
});
function callTrigger(target,div_id){
console.log(com.greensock.plugins.ScrollToPlugin.version);
TweenMax.to(window, 2, {scrollTo:{y: div_id, offsetY:50000}});
}
Looking forward for your best solution asap.
Thanks & Regards,
Karamveer Singh