html - CSS3 transition on matrix transformation with jQuery on FF/Chrome -


i've written simple little transition animation on page load should reveal content little opening of window blind. uses combination of css3, set transition values, , jquery apply change transform: matrix values on page load. works fine in safari, life of me can't grasp why transition effect doesn't work on ff or chrome. in both browsers, 'blind' disappears reveal content after transition display, rather transitioning out in 4 vertical strips should.

code below, i've put fiddle here (which, works in safari, can see sort of effect i'm expecting):

https://jsfiddle.net/ebenezer66/783uh6k3/

the basic html:

<div class="home__columnshades__div">   <div class="home__columnshades__div__column">     <div class="home__columnshades__div__columnone"></div>   </div>   <div class="home__columnshades__div__column">     <div class="home__columnshades__div__columntwo"></div>   </div>   <div class="home__columnshades__div__column">     <div class="home__columnshades__div__columnthree"></div>   </div>   <div class="home__columnshades__div__column">     <div class="home__columnshades__div__columnfour"></div>   </div> </div> 

scss:

.home__columnshades__div {   width: 100%;   height: 100%;   position: absolute;   top: 0;   z-index: 899; }  .home__columnshades__div__column {   width: 25%;   height: 100%;   float: left; }  .home__columnshades__div__columnone {   position: absolute;   left: 0;   height: 100%;   width: inherit;   background-color: #000;   transition: transform 3s;   transition-delay: 0.5s;   background-repeat: no-repeat;   background-size: cover;   background-position: top left; }  .home__columnshades__div__columntwo {   @extend .home__columnshades__div__columnone;   left: 25%; }  .home__columnshades__div__columnthree {   @extend .home__columnshades__div__columnone;   left: 50%; }  .home__columnshades__div__columnfour {   @extend .home__columnshades__div__columnone;   left: 75%; } 

jquery:

  var viewwidthquarter = $(window).width() / 4;    $('.home__columnshades__div__columnone').css({     'transform': 'matrix(0, 0, 0, 1, -' + viewwidthquarter / 1.5 + ', 0)'   });   $('.home__columnshades__div__columntwo').css({     'background-position': '-' + viewwidthquarter + 'px' + ' 0',     'transform': 'matrix(0, 0, 0, 1, -' + viewwidthquarter / 1.5 + ', 0)'   });   $('.home__columnshades__div__columnthree').css({     'background-position': '-' + viewwidthquarter * 2 + 'px' + ' 0',     'transform': 'matrix(0, 0, 0, 1, -' + viewwidthquarter / 1.5 + ', 0)'   });   $('.home__columnshades__div__columnfour').css({     'background-position': '-' + viewwidthquarter * 3 + 'px' + ' 0',     'transform': 'matrix(0, 0, 0, 1, -' + viewwidthquarter / 1.5 + ', 0)'   }); 

although haven't solved why transform: matrix (or translate) won't work on ff/chrome, i've reworked code use transition on left position of each vertical blind instead of transform's translate value. works bit better - animation smoother.

https://jsfiddle.net/ebenezer66/ttgp8bj4/

updated jquery:

  var viewwidth = $(window).width(),   viewwidthquarter = viewwidth / 4;    $('.home__columnshades__div__columnone').css({     'left': viewwidth-(viewwidthquarter*4.5) + 'px',     'transform': 'scalex(0)'   });   $('.home__columnshades__div__columntwo').css({     'background-position': '-' + viewwidthquarter + 'px' + ' 0',     'left': viewwidth-(viewwidthquarter*3.5) + 'px',     'transform': 'scalex(0)'   });   $('.home__columnshades__div__columnthree').css({     'background-position': '-' + viewwidthquarter * 2 + 'px' + ' 0',     'left': viewwidth-(viewwidthquarter*2.5) + 'px',     'transform': 'scalex(0)'   });   $('.home__columnshades__div__columnfour').css({     'background-position': '-' + viewwidthquarter * 3 + 'px' + ' 0',     'left': viewwidth-(viewwidthquarter*1.5) + 'px',     'transform': 'scalex(0)'   }); 

updated css:

.home__columnshades__div {   width: 100%;   height: 100%;   position: absolute;   top: 0;   z-index: 899; }  .home__columnshades__div__column {   width: 25%;   height: 100%;   float: left; }  .home__columnshades__div__columnone {   position: absolute;   left: 0;   height: 100%;   width: inherit;   background-color: #000;   transition: transform 3s, left 3s;   transition-delay: 0.5s;   background-repeat: no-repeat;   background-size: cover;   background-position: top left; }  .home__columnshades__div__columntwo {   @extend .home__columnshades__div__columnone;   left: 25%; }  .home__columnshades__div__columnthree {   @extend .home__columnshades__div__columnone;   left: 50%; }  .home__columnshades__div__columnfour {   @extend .home__columnshades__div__columnone;   left: 75%; } 

Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -