我正在使用节点JS,并且我们构建了一个完美的聊天工具,现在我们正在转移到它的CSS部分。JQuery底部固定div切换向上移动所有div
现在我现在遇到的问题是,当我们有多个选项卡,并且我们只点击一个选项卡时,所有选项卡都会向上移动。
这可以在下面的图片中查看。红色区域是div
该选项卡中显示,他们应该能够与CSS 1片
上向下移动
前
后点击后再点击一个标签向你展示我的jQuery部分正确
This是一个固定的div如所示的图像在页面
下面此代码被重复用于每个标签的底部,但具有不同的ID,tramsTalk
,Calvin
,srcc-test
坐着。
<div style="position:fixed;bottom:0;right:26px;background-color:red;">
<div id="tramsTalk_chat" style="background-color:white;position:relative;bottom:0px;width:275px;float:right">
<div id="tramsTalk_chat_header" class="chat_header"><p><i class="icon-chevron-up icon-white pull-right"></i>tramsTalk</p></div>
<div class="overflow_chat" id="tramsTalk_chat_textarea"><hr style="margin-top:-8px;margin-bottom:1px;"></div>
<div class="chat_textarea_holder" id="tramsTalk_msg_textarea_holder"><textarea class="chat_box" rows="3" id="tramsTalk_msg" ignoreesc="true" name="tramsTalk_chat_message" onkeyup="check(this,event);" style="resize: none; overflow-y: hidden; "></textarea></div>
</div>
</div>
我认为这样会起作用,它仍然保持标签在顶部。
只是重申:
jQuery的工作正常,我们切换而移动标签了应该仍然被固定到了谷底。 (我可以点击它们,然后他们将拉下文本框)。我认为CSS是问题,我不确定。
SOLUTION
<style>
.wrappers > div {
margin-top: 275px;
}
.active {
height: 300px;
background-color: white;
margin-top: 0 !important;
}
</style>
<script type="text/javascript">
$(document).ready(function(){
$('#Calvin_chat').click(function(){
alert('test');
$(this).attr('class','active');
});});
</script>
就像一个魅力!
我们可以看到jQuery的? – Connor 2012-04-26 23:59:02