簡單,開始了新的接口:爲什麼這個jQuery代碼只在opera下運行,而不是在firefox和chrome下運行?
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="./style/style.css" />
<script src="./javascript/jquery-1.10.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var color = $('#title_buttom').css('background-color');
$('.title_all').mouseover(function(){
var styles = {
backgroundColor : '#FF0C55'};
$('#title_buttom').css(styles);
});
$('.title_all').mouseout(function(){
$('#title_buttom').css('background-color',color);
});
});
</script>
</head>
<body>
<div id='all_div'>
<div id='master'>
<div id='title_top'>
<div id='title_home' class='title_all'>Home</div>
<div id='title_info' class='title_all'>Info</div>
<div id='title_project' class='title_all'>Projects</div>
<div id='title_contectus' class='title_all'>Contect us</div>
</div>
<div id='title_buttom'></div>
</div>
</div>
</body>
</html>
爲同樣的原因,我不知道爲什麼只有Opera瀏覽器可以同時在火狐和Chrome無法使用這個代碼。這是爲什麼?
看起來好像沒什麼問題http://jsfiddle.net/arunpjohny/9dtrd/1/ –
嘗試$( 'title_all ')。在(' 鼠標移開',函數(){ $('#title_buttom ').css('background-color',color); });我添加了回答...猜這應該工作...請評論我的帖子,如果它可以正常工作 – Dwza