0
在外打工創建一個應用程序,在點擊事件和功能無法正常工作div中元素的父DIV HTML正常工作是jQuery的點擊功能是不是在div容器內工作,DIV
<div class="chat_wrapper">
<span class="fa fa-minus minimize"></span>
<div class="module" id="45-module" style="height: 316px;">
<div class="top-bar">
<div class="left">
<span class="icon typicons-message"></span>
<h1 class="username">rudra-chat</h1>
</div>
<div class="right">
<span class="fa fa-plus maximize" style="display:none"></span>
</div>
</div>
<ol name="log" id="45-log" class="discussion"></ol>
<div class="message" id="45-msg">
<input type="text" name="message" id="message" onkeypress="sendmessage(this,event);">
</div>
</div>
</div>
我正在特林這一個點擊數
$(document).ready(function(){
$('.minimize').click(function() {
alert('sadg');
$('.module').animate({ height: '30px' }, 500);
$('.minimize').hide();
$('.maximize').show();
});
$('.maximize').click(function() {
$('.module').animate({ height: '316px' }, 500);
$('.minimize').show();
$('.maximize').hide();
});
});
CSS代碼
.chat_wrapper {
bottom: 0;
position: fixed;
right: 167px;
}
.module {
float: left;
margin-right: 2px;
width: 300px;
}
.top-bar:before {
animation: 1s ease 0s alternate none infinite running pulse;
background: radial-gradient(#ffffff, #000000) repeat scroll 0 0 rgba(0, 0, 0, 0);
bottom: -100%;
content: "";
left: 0;
opacity: 0.25;
position: absolute;
right: 0;
top: -100%;
}
.top-bar {
background: none repeat scroll 0 0 #666;
color: white;
overflow: hidden;
padding: 0.5rem;
position: relative;
}
,但它不工作沒有錯誤我試過上的同樣的功能chat_wrapper click event and this is working properly
的' .top-bar:「之前」與「.maximize」元素重疊並防止點擊到達它。 – 2015-02-24 11:38:48
沒有影響我刪除了這個 – MKD 2015-02-24 11:43:19
你確定嗎?它的作品,當我在這裏註釋它:http://jsfiddle.net/pmsk3xzn/ – 2015-02-24 11:45:25