javascript - jQuery Follow the cursor horizontaly with a DIV -
Cutting the container, I need to follow the cursor horizontally in the div I
Any such
but the above link
Em> are both vertical or horizontal I do not want toI have created a demo
$ ("#dh- thumb> li"). Hover (function () ($ ("div"). Show ();}, function () {$ ("div"). Hide ();}); $ ('# d-thumb » Season (function (e) {$ ("div"). CSS ({left: e.pageX - 120});}); .da-thumbs {list-style: none; padding: 20px; display: inline-block;} .da-thumb li {width: 200px; height: 200px; background: # 000; Swimming Left; Margin: 5 px; Position: Relative; Z-index: 0;} .DA-thumb ltd. A {display: block; status: relative; hidden plume; text-decoration: none;} .DA - organ Pratha Li A Div {Display: None; Position: Relative; Background: # 777; Background: RGBA (75, 75, 75, 0.7); Width: 200px; Height: 200px; Z-Indic: 3;} .ADA- Thumbs li a div span {display: block; padding: 10 px 0; margin: 40px 20px 20px 20px; text-transform: uppercase; font weight: normal; color: #fff; color: rgba (255, 255, 255, 0.9) ); Text-shadow: 1 px 1 px 1 px rgba (0, 0, 0, 0.2); Border bottom: 1 px solid rgba (255, 255, 255, 0.5); Box-shadow: 0 1 px 0 rgba (0, 0, 0, 0.1), 0 -10 px rgba (255, 255, 255, 0.3); } & lt; Script src = "https://ajax.googleapis.com/ajax/libs/JQuery/1.1.1/jquery.min.js" & gt; & Lt; / Script & gt; & Lt; Ul id = "da-thumb" class = "da-thumb" & gt; & Lt; Li & gt; & Lt; A href = "" & gt; & Lt; Div & gt; & Lt; Span & gt; Menu by Simon Jensen & lt; / Span & gt; & Lt; / Div & gt; & Lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "" & gt; & Lt; Div & gt; & Lt; Period & gt; Mr. Crabs by John Janlowe & lt; / Span & gt; & Lt; / Div & gt; & Lt; / A & gt; & Lt; / Li & gt; & Lt; / Ul & gt;
(code) $ ( "# Da-thumps take"). Hover (function {$ (this) .find ("div"). Show ();}, function () {$ (this) .find ("Div"). Hide ();}); $ ('# Da-thumpbs li'). MouseMove (function (e) {var $ this = $ (this); $ this.find ("div"). CSS ({left: e.pageX - $ this.position (.left - 120});}) ; Here is the code to work on.
But with this you will completely lack the "easy" / animation which is the demo you have added. If there is something that you want you to use a different approach if yes, then maybe there is something I can help you too.
Comments
Post a Comment