我有一个替换普通 webkit/mozilla 滚动条的 javascript 滚动条。只需输入 div 名称“.element”,它就可以在我的所有其他 div 上工作,但是我不确定如何让滚动条应用于文本区域?有谁知道我会怎么做,谢谢任何人的帮助。
JAVASCRIPT:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<script src="assets/js/scroll/jquery.mousewheel.min.js"></script>
<script src="assets/js/scroll/jquery.mCustomScrollbar.js"></script>
<script>
(function($){
$(window).load(function(){
$(".bio textarea").mCustomScrollbar();
});
})(jQuery);
</script>
HTML:
<form action="includes/changebio.php" method="post" id="form1">
<textarea id="bio" style="width: 442px;
margin-top:3px;
text-align:left;
margin-left:-2px;
height: 120px;
resize: none;
outline:none;
border: hidden;" textarea name="bio" data-id="bio" maxlength="710"><?php echo stripslashes($profile['bio']); ?></textarea>
<input type="image" src="assets/img/icons/save-edit.png"class="bio-submit" name="submit" value="submit" id="submit"/>
</form>