Last active
December 27, 2016 15:09
-
-
Save xShirase/bc7b50cf5c4522ed16158fe7b40555f0 to your computer and use it in GitHub Desktop.
reverse box - usable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var f = $('#shoutbox form').detach(); | |
$('#shoutbox').append(f); | |
var objDiv = document.getElementById("sbf"); | |
objDiv.scrollTop = objDiv.scrollHeight; | |
ul = $('#sbf'); | |
ul.children().each(function(i,li){ul.prepend(li)}) | |
function handler(e) { | |
var target = e.target; | |
$('#sbf').off('DOMNodeInserted', 'div', handler); | |
$('#sbf').append(target); | |
$('#sbf').on('DOMNodeInserted', 'div', handler); | |
var objDiv = document.getElementById("sbf"); | |
objDiv.scrollTop = objDiv.scrollHeight; | |
}; | |
$('#sbf').on('DOMNodeInserted', 'div', handler); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment