我只是将emojionearea.js应用于我的textarea,但是emoji显示在我的textarea的顶部,对用户隐藏了它的视图。
我想知道如何将其容器放置在我的文本区域的底部。
我的代码:
$(document).ready(function() {
$(".emoji_act").emojioneArea({
emojiPlaceholder: ":smile_cat:",
searchPlaceholder: "Search",
buttonTitle: "Use your TAB key to insert emoji faster",
searchPosition: "bottom",
});
});
<link href="https://rawgit.com/mervick/emojionearea/master/dist/emojionearea.css" rel="stylesheet"/>
<div class="container-fluid pt-3">
<form method="POST" action="" enctype="multipart/form-data">
<div class="form-group">
<font color="#a1a1a1"><span id="count"></span> characters remaining</font>
<textarea type="text" name="bio" class="form-control emoji_act" id="bio" placeholder="10 - 140 characters" onkeyup="count_char(this, 140)"></textarea>
<span id="bio_val"></span>
</div>
<div class="form-group">
<button id="ok_but" class="btn btn-primary btn-block" type="submit" name="ed_submit">
Done
</button>
</div>
</form>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="https://rawgit.com/mervick/emojionearea/master/dist/emojionearea.js"></script>
最佳答案
为了学习如何使用此js库,请遵循this document。
现在让我们解决您当前的问题:
您可以在传递给pickerPosition
jquery函数的初始配置中将属性bottom
设置为emojioneArea
。
$(document).ready(function() {
$(".emoji_act").emojioneArea({
emojiPlaceholder: ":smile_cat:",
searchPlaceholder: "Search",
buttonTitle: "Use your TAB key to insert emoji faster",
searchPosition: "bottom",
pickerPosition: "bottom"
});
});
<link href="https://rawgit.com/mervick/emojionearea/master/dist/emojionearea.css" rel="stylesheet" />
<div class="container-fluid pt-3">
<form method="POST" action="" enctype="multipart/form-data">
<div class="form-group">
<font color="#a1a1a1"><span id="count"></span> characters remaining</font>
<textarea type="text" name="bio" class="form-control emoji_act" id="bio" placeholder="10 - 140 characters" onkeyup="count_char(this, 140)"></textarea>
<span id="bio_val"></span>
</div>
<div class="form-group">
<button id="ok_but" class="btn btn-primary btn-block" type="submit" name="ed_submit">
Done
</button>
</div>
</form>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="https://rawgit.com/mervick/emojionearea/master/dist/emojionearea.js"></script>