2013-12-10 21 views
-5

我有這個jQuery代碼和HTML它工作在jsfiddle.com(http://jsfiddle.net/9rJev/),這是工作的例子,但是當我得到它記事本++其不工作,這是我的代碼記事本++jquery不工作在我的設備

<html> 
<head> 
<script type="text/javascript" src="js/jquery.1.3.2.min.js" ></script> 
<script type="text/javascript" src="js/jquery.1.6.4.min.js" ></script> 
<script type="text/javascript" src="js/jquery-ui.min.js" ></script> 
<script src="//code.jquery.com/jquery-1.10.2.js"></script> 
<script type="text/javascript"> 
$('#movedown').ready(function(){ 
    `$('#test').slideUp();` 
}) 
$('#movedown').mouseover(function() { 
$('#test').slideDown(); 
}); 
$('#movedown').mouseleave(function(){ 
$('#test').slideUp(); 
}); 
</script> 

</head> 
<body> 

    <div id="movedown"> 
    <h4>yazan</h4> 
    <div id="test" style="background-color:lightgrey; border:2px solid grey;padding:10px;">Hello, this will slide down.</div> 
    </div> 
</body> 

</html> 

但它不適用於谷歌瀏覽器任何人都知道什麼是issu。 請help.and感謝

+2

你已經包含jQuery庫三次(v1.3.2,v1.6.4和v1.10.2)。嘗試刪除其中的兩個。 – BenM

+5

任何理由包括** 3 ** jquery版本??? –

+0

@BenM no,3次 –

回答

0

改變你的JS到這一點:

$(document).ready(function(){ 
    $('#movedown').ready(function(){ 
     $('#test').slideUp(); 
    }) 
    $('#movedown').mouseover(function() { 
     $('#test').slideDown(); 
    }); 
    $('#movedown').mouseleave(function(){ 
     $('#test').slideUp(); 
    }); 
}); 

並且還刪除所有,但1個jQuery的參考。注意你需要包含ready函數,並且你在$('#test')附近有一些奇怪的字符。這導致了JS錯誤。這些小的改動後,你的代碼對我來說表現很好。

+0

感謝您的幫助 – user2876019

相關問題