inputTip css+js

<pre name="code" class="javascript"><div style="position:relative;">
    <label style="position:absolute; left:180px; top:30px; color:#aaa;cursor:text;">输入提示</label>
    <input type="text" class="inputTip"/>
</div>


<script type="text/javascript">
<span style="white-space:pre">	</span>$(".inputTip").prev().click(function () {
            $(this).next().focus();
        });
        $(".inputTip").focus(function () {
            $(this).prev().hide();
        }).blur(function () {
            if ($(this).val() == "") {
                $(this).prev().show();
            }
        });
</script>




                
``` <div class="chat-right-content w100 h100"> <div class="chat-right-content-list w100" @scroll="handleScroll"> </div> <!-- 底部输入框 --> <div class="chat-input w100"> <div class="chat-input-warp w100" > <!-- <textarea @submit.prevent="getQuestion(1)" class="chat-input-box" :placeholder="T.placeholder" v-html="mdRender(contentVal)" v-model="contentVal" :disabled="isProcessing"></textarea> --> <div @keydown.enter.prevent="handleEnter" class="chat-input-box" contenteditable="true" ref="contentEditable" :placeholder="contentVal ? '' : placeholder" enterkeyhint="send" v-contenteditable="contentVal" @input="onInput" :disabled="isProcessing" tabindex="0" autocomplete="off" spellcheck="false" ></div> <div class="chat-input-btn-warp flex justify-content-between align-items-center"> <!-- 提交 --> <tooltip-components :key="tipKey" :content="isProcessing ? T.talkPadding : (contentVal? '' : T.inputTip)"> <el-button :disabled="isProcessing || !contentVal" size="small" type="primary" :icon="isProcessing ? 'el-icon-loading' : 'el-icon-top'" circle style="font-size: 15px; margin-left: 5px; font-weight: 900" @click="getQuestion(1)" ></el-button> </tooltip-components> </div> </div> </div> </div>2```代码其他逻辑都不要管 只加一个chat-input-box输入框输入内容过多 chat-input自动加高 是向上1加高度 设定一个最高 超过最高不在加高 内容过多加高时需要动态减掉chat-right-content-list对应的高度 contentVal如果没值了 chat-input和chat-input-box,chat-right-content-list就恢复原来高度
03-08
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值