function pasteHtmlAtCaret(html) {
var sel, range;
if (window.getSelection) {
// IE9 and non-IE
sel = window.getSelection();
if (sel.getRangeAt && sel.rangeCount) {
range = sel.getRangeAt(0);
range.deleteContents();
// Range.createContextualFragment() would be useful here but is
// non-standard and not supported in all browsers (IE9, for one)
var el = document.createElement("div");
el.innerHTML = html;
var frag = document.createDocumentFragment(), node, lastNode;
while ((node = el.firstChild)) {
lastNode = frag.appendChild(node);
}
range.insertNode(frag);
// Preserve the selection
if (lastNode) {
range = range.cloneRange();
range.setStartAfter(lastNode);
range.collapse(true);
sel.removeAllRanges();
sel.addRange(range);
}
}
} else if (document.selection && document.selection.type != "Control") {
// IE < 9
document.selection.createRange().pasteHTML(html);
}
}
caret+=(txt.split(' ').length-1)*5;
$handle = curl_init($url);
curl_setopt($handle, CURLOPT_RETURNTRANSFER, TRUE);
$response = curl_exec($handle);
$httpCode = curl_getinfo($handle, CURLINFO_HTTP_CODE);
curl_close($handle);
if($httpCode == 200) {
$data=str_get_html($response);
}
<div class='div1'>
<div class='div2'>
many_text
</div>
<div class='div3'>Вниз</div>
</div>
.div1 {
overflow:hidden;
height:100px;
position:relative;
}
.div2 {
position:absolute;
top:0;
}
.div3 {
position:absolute;
bottom:0;
width:100%;
text-align:center;
}
$(document).on('click','.div3',function(){
$('.div2').animate({top:'-=100'},300);
});
$(document).on('change','input[name*=live5]',function(){
checkedVal=$('input[name*=live5]:checked').val();
$('select[name=kolisestvo]').prop('disabled',checkedVal==',live2');
});