css - Direction aware hover effect with jquery mouseOver has a direction error -


I got a conscious effect about this great direction that I want to apply to my website. I have found this issue that when the right part of the box rotating from the top of the element will be recorded as the hover from the right / instead of the top of the 1/4 element.

Here is the working code to look for.

I do not know where this error is coming from. I have padding, margins, perspective, width, and amp; Height. I can not seem to find out where the error is coming from.

I believe the problem is in the script code, which is below:

  var nodes = document QuerySelectorAll ('li'), _nodes = [] .slice .call (nodes, 0); Var getDirection = function (ev, obj) {var w = obj.offsetwidth, h = obj.offsetHeight, x = (ev.pageX - obj.offsetLeft - (w / 2) * (w> H? (H / W)): 1)), y = (ev.pageY - obj.offsetteop - (h / 2) * (h & w; w? (W / h): 1)), d = monastery (Math., X) / 1.57079633 + 5)% 4; Return D; }; Var addClass = function (ev, obj, state) {var direction = getDirection (ev, obj), class_suffix = ""; Obj.className = ""; Switch (direction) {case 0: class_suffix = '-top'; break; Case 1: class_sx = 'right'; break; Case 2: Class_safix = '-bottom'; break; Case 3: class_suffix = '-left'; break; } Obj.classList.add (state + class_sfix); }; // bound events _nodes.forEach (function (L) {el.addEventListener ('mouseover', function (ev) {addClass (ev, this, 'in');}, wrong); el.addEventListener ('mouseout' function (Ev) {addClass (ev, this, 'outside');}, false);});  

This is the conversion / animation css:

  li .info {width: 100%; Height: 100%; Padding: 20px; Status: Completed; Top: 0; Left: 0; Boundary-radius: 4px; Pointer-phenomena: none; Background color: RGBA (26, 188, 156, 0.9); Consequently rotating 3D (1, 0, 0, 90 degrees);} top Top. Info {conversion-origin: 50% 0%; Animation: Ease of 0 MMS 1 in in-top 300ms;} .in-right ..in {transform-origin: 100% 50%; Animation: Ease of 0ms 1 in in-right 300ms;} down down. Info {transform-origin: 50% 100%; Animation: Ease of at least 300ms 0ms 1;} .in-left..info {transform-origin: 0% 0%; Animation: 0ms 1 in the in-left 300ms go forward;}. Top-top Info {transform-origin: 50% 0%; Animation: Out-top 300ms 0ms further than 1;} Absolutely right Info {conversion-basic: 100% 50%; Animation: 300ms 0ms ahead of the right-hand side;; Out-down Info {transform-origin: 50% 100%; Animation: Out-down 300ms further than 0ms 1;}. Out-left. Info {conversion-origins: 0% 0%; Animation: Out-left 300ms 0ms 1 go forward;} @ keyframe in-top {from {transform: rotate 3D (-1, 0, 0, 90 degrees); } To {transform: rotate 3D (0, 0, 0, 0deg); }} @keyframe in-right {from {transform: rotate 3D (0, -1, 0, 90 degrees); } To {transform: rotate 3D (0, 0, 0, 0deg); }} @ Keyframe in-floor {to transform: rotate 3D (1, 0, 0, 90 degrees); } To {transform: rotate 3D (0, 0, 0, 0deg); }} @ Keyframe in {from {transform: rotate 3D (0, 1, 0, 90 degrees); } To {transform: rotate 3D (0, 0, 0, 0deg); }} @ Keyframe out-top {from {transform: rotate 3D (0, 0, 0, 0 degree); } {Transform: rotate 3D (-1, 0, 0, 102 degrees); }} @ Keyframe outright {to {transform: rotate 3D (0, 0, 0, 0 degree); } To {transform: rotate 3D (0, -1, 0, 102 degrees); }} @ Keyframe out-to-end {transform: rotate 3D (0, 0, 0, 0 degree); } To {transform: rotate 3D (1, 0, 0, 101 degrees); }} @ Keyframe out-left {from {transform: rotate 3D (0, 0, 0, 0 degree); } To {conversion: rotate 3D (0, 1, 0, 102 degrees); }}  

You can find HTML on CodePen I above.

Again - what is happening with me, since the hovering in the element at the top right, it is not registered as the hovering from the top, it registers as the hovering from the right side and accordingly Overlay infects the device.


Comments

Popular posts from this blog

eclipse plugin - Run java code error: Workspace is closed -

ios - How do I use CFArrayRef in Swift? -

scala - Play Framework - how to bind form to a session field -