Js controls the timeline


#1

Hello everyone, I have a problem, that is, I have a button, click the button is a js, Is a judge of the browser:

function is_weixin(){
var ua = navigator.userAgent.toLowerCase();
if(ua.match(/MicroMessenger/i)==“micromessenger”) {
return true;
} else {
return false;
}
}

So, if return true,can run a timeline?


(kaiwiaho) #2

var ua = navigator.userAgent.toLowerCase();
if(ua.match(/MicroMessenger/i)==“micromessenger”) {
hypeDocument.startTimelineNamed(‘timelineName’, hypeDocument.kDirectionForward);
} else {
return false;
}
}


#3

OK,I got it! Thx!