Jump to content
Search Community

Syntax error in IE

Donzé test
Moderator Tag

Recommended Posts

Hello,

 

I have a syntax error in the IE debugger under IE version 11 and lower. (See capture in PJ)

 

Here is my code:

// animation Menu

const boutonOpen = document.querySelector('#open-button');
const boutonClose = document.querySelector('#close-button');

const tl = gsap.timeline({paused : true});

tl.to('.pull-menu', 0.5, {opacity:1,ease: Power2.easeOut}, '-=0.5');

tl.staggerFrom('.wifeo_rubrique', 0.4,{ y:30, opacity:0}, 0.05)
var rule02 = CSSRulePlugin.getRule(".menu-part-left::after"); //get the rule
tl.to(rule02, {duration: 0.5, cssRule: {width: 95}},'-=0.3')
tl.staggerFrom('#accordion li', 0.4,{ y:30, opacity:0, delay:-0.5}, 0.05)
tl.staggerFrom('.menu--bas-page li', 0.5,{ y:50, opacity:0, delay:-1}, 0.1)
var rule = CSSRulePlugin.getRule(".pull-menu-open::after"); //get the rule
tl.from(rule, {duration: 0.3, cssRule: {height: 0, ease: Power2.easeOut}},'=-0.5')
var rule01 = CSSRulePlugin.getRule(".pull-menu-open::before"); //get the rule
tl.to(rule01, {duration: 0.3, cssRule: {opacity: 1, ease: Power2.easeOut}},'=-0.2' )

boutonOpen.addEventListener('click', (e) => {
  
  if(tl.isActive()){
    e.preventDefault();
    e.stopImmediatePropagation();
    return false;
  }
  tl.restart();

});

It seems that it does not accept the sign "=>" in the first line "buttonOpen.addEventListener ('click', (e) => {

How do I modify my code to no longer have the error?

 

Thank you in advance for your help.

 

cordially,

Maxime Donze

See the Pen qBZmqQK by Maximus398 (@Maximus398) on CodePen

Link to comment
Share on other sites

It's was able to fix it, I simply replaced

 

boutonOpen.addEventListener('click', (e) => {
  
  if(tl.isActive()){
    e.preventDefault();
    e.stopImmediatePropagation();
    return false;
  }
  tl.restart();

});

with

boutonOpen.addEventListener('click', function(e) {
  
  if(tl.isActive()){
    e.preventDefault();
    e.stopImmediatePropagation();
    return false;
  }
  tl.restart();

});

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...