Hello, I create a div, it can move and change its size, but when I click on it (I have an event standing at the click, which receives the contents of the block), it displays a lot of unnecessary to me, if I bring it out to the div, it’s normal, and if on alert or in textarea, it is superfluous. And why when the data is displayed in a Div, the same “triangle” for the stretching of the block appears on the bottom right, and scrolls appear. How to deal with these scrolls? Thank you in advance. Here is a link to the code http://jsfiddle.net/Zkolya_linkoln/u88nncLu/3/
1 answer
Solution: replace
var soder=$(this).html(); on
var soder=$(this).text(); Why do you see trash? Your div is not empty, as it may seem. The fact is that you connect the plug-ins for resizing and dragging an element (this is also the answer to the question - “the same triangle appears at the bottom”). These plugins add to your div.
<div id="div_1"> 1 <div class="ui-resizable-handle ui-resizable-e" style="z-index: 1000;"></div> <div class="ui-resizable-handle ui-resizable-s" style="z-index: 1000;"></div> <div class="ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se" style="z-index: 1000;"></div> </div> Using $ (element) .html (), you can get the entire contents of the element along with its descendants, while $ (element) .text () is just the content of the block.
|