javascript - How Select text on mouseover and then put it into a variable for further use in php -
I need to fix as the web page
When you hover over a paragraph , Has been placed in block variables with a share button and paragraph text.
Can anyone help me with this?
Here's what I got, but I do not understand why it does not work:
$ ('. Line'). Hover (function () {$ ( '. Line'). RemoveClass ( 'hover'); $ (this). AddClass ( "hover"). Next (). AddClass ( "hover"). Next (). AddClass ( 'Hover'). Next (.) AddClass ('hover');}); $ ('. Line'). Hover (function () ($ ( '. Line'). RemoveClass ( 'hover'); $ ( "# shared-image"). Attachment (it); KappendTo ( "# Destination"); $ (this). addClass ( 'hover'). next (). AddClass ( 'hover'). next (). AddClass ( 'hover'). next (). AddClass ( 'hover');}); CSS:
.line.hover {background-color: # 3333FF;}
when you mouseover to get a group of speaking is applied to offset relative to the container height and the second division which is at the right. This code gives you 85%
Here's my JS:
var $ share = $ ('div square = "share"> fp t '), $ Song = $ (' song '); $ Lyrics.append ($ share); $ Lyrics.on (' mouseover ',' p ', function () {var $ this = $ (this), height = $ This.height (), top = $ this.position (). Top; $ share .css ({top: height: height, background color: 'red'}). Data ('song', $ this.text ());}); $ Share.on ('click', function () {warning ($ sharedata ('song'));}; And there is a small demo here:
Comments
Post a Comment