javascript - How to prevent CSS3 transform from make elements unclickable -


Please refer to my live code:

CSS3 translation : Rotates () makes the elements invisible until rotations == 0

I am using accelorameter to move elements on an axis Unfortunately, these elements are not untouched when their rotation (0,0,0) does not occur. How can I fix this, so that all the elements are clickable all the time?

  & lt; Div ng-app = "morningharwoodApp" ng-controller = "MainCtrl" & gt; & Lt; Div class = "wrap" & gt; & Lt; Div class = "cube" & gt; & Lt; Div class = "icon-wrapper" & gt; In sections & lt; Div class = "symbol" ng-repeat = "(key, val)" ng-style = "perspective" ng-click = "toggle.menu ()" & gt; & Lt; P & gt; X: {{acceleration.x}} & lt; / P & gt; & Lt; P & gt; Y: {{acceleration.y}} & lt; / P & gt; & Lt; P & gt; Z: {{acceleration.z}} & lt; / P & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt;  

CSS:

  html, body, .page-container {box-size: border-box; Height: 100%; Padding: 0; Margin: 0; } *, *: First, *: after {box-size: heir; } .group: after {content: ""; Display: Table; Clean both; }. Wrap {status: relative; Width: 100%; Height: 100%; Padding: 3.5%; Font-family: helvetica, ariel, non-serif; }. Cbe {status: relative; Width: 100%; Height: 100%; Background: URL (http://placekitten.com/1600/1080); Background size: cover; Padding: 30px; @extend .group; } .con-wrapper {@extend .group; } .file {@extend .group; Height: 100%; Width: 100%; Status: Relative; Top: 0; Left: 0; Background: #fff; } Cannes {padding: 25px; Height: 250px; Width: 250px; Margin: 12px; Color: #fff; Background: black; Swim left; Webkit-transform: translatejad (0); -MOZ-transmase: translate Z (0); -mms-transform: translatejad (0); -o-conversion: translate (0); Conversion: Translucent (0); Webkit-Conversions: Translation 3D (0, 0, 0); -MOZ-TRANSFORM: Translation 3D (0, 0, 0); -MMS-Conversions: Translation 3D (0, 0, 0); Conversion: Translation 3D (0, 0, 0); -WebKit-Infection: -WebKit-Transformations Easy to MMS 500; -Mozy-transit: -Moz-transforms 250ms easily; -O-Infection: -A-Transform 250ms easily; Transition: Easily change 250ms; Conversion-style: protection-3d; Webkit-Backfiest-Visibility: hidden; -MOZ-BACKEX-visibility: hidden; -MM-Backup-visibility: hidden; Backfirst-visibility: hidden; -webkit-change-origin: top center; -Mo-transform-origin: top center; -O-Change-Origin: Top Center; Change-Origin: Top Center; -webkit- Consequently: translateZ (1px); }  

JS:

  $ scope.navigation = {status: false}; $ Scope.toggle = {Menu: Function () {$ scope.navigation.status =! $ Scope.navigation.status; Console.log ($ scope.navigation.status); }}; $ Scope.squares = [1,2,3,4,5,6,7,8]; If ($ window.DeviceMotionEvent! == Undefined) {$ window.ondevicemotion = function (event) {$ scope.acceleration = {x: Math.min (parseInt (event.accelerationIncludingGravity.x * 10), - 30), 30). 0, Y: Math.Man (Math.Max ​​(Perspective (Event AcceleratingGravity.I * 2), -30), 30). 0, Z: Math.Man (Math Max. (Persistent (Incorporation involving Gravity), -30), 30). 0}; $ Scope Model = {conversion: 'perspective (800px) rotate (' + $ scope.acceleration.x + 'deg)' + 'rotateX (' + $ scope.acceleration.y + 'deg)' // 'rotateX (' + $ Scope.acceleration.x + 'deg)' + rotateZ ('+ $ scope.acceleration.z +' deg) '}; $ Scope $ digest (). }; }  

I looked around playing around that if I had Y axis, my copy The outgoing side will be "clickable", while adding "z-index: 1" to one of the container divisions (icon-wrapper or cube or wrap) that will not be pointing to the side.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -