Простейший smile-BOX с ползунком
Добавлено: 08 окт 2017, 17:28
В настройках стиля добавить:
Либо есть еще вариант:
- В файлеoverall_footer_after.html добавить
Тогда смайлы будут растягиваться в низ с формой ответа.
Первоисточник и автор скрипта CabinetAdmin
Код: Выделить всё
/* Смайлы с ползунком */
#smiley-box {
height: 300px;
overflow: auto;
}
- В файле
Код: Выделить всё
<script type="text/javascript">
$(function() {
var txt = $('#message-box textarea'),
sBlock = $('#smiley-box').css({
'max-height': '500px',
'min-height': txt.height()+'px',
'height': txt.height()+'px',
'overflow-x': 'auto'
}).append('<div class="smiles-div" style="display: none;" />'),
hdBlock = $('.smiles-div'),
content = null,
height = txt.height();
txt.bind('keyup', function() {
content = txt.val();
content = content.replace(/\n/g, '<br>');
hdBlock.html(content);
sBlock.css('height', hdBlock.height());
});
});
</script>