我米試圖顯示和隱藏使用jquery淡入和淡出方法中的一些元素(跨度)所以就用下面的代碼:Jquery的淡入淡出不IE8工作,但在鉻工作,火狐
<script type="text/javascript">
$(document).ready(function(){
$("a.moretag").click(function(){
$("span.hideelement").fadeIn("slow");
$("a.moretag").fadeOut("slow");
$("a.lesstag").fadeIn("slow");
});
$("a.lesstag").click(function(){
$("span.hideelement").fadeOut("slow");
$("a.lesstag").fadeOut("slow");
$("a.moretag").fadeIn("slow");
});
});
</script>
.....
<span class="hideelement" style="display:none;">First</span>
<span class="hideelement" style="display:none;">Second</span>
.
.
<span class="hideelement" style="display:none;">Tenth</span>
<a class="moretag"><strong>More</strong></a>
<a class="lesstag" style="display:none;"><strong>Less</strong></a>
.....
在上面的代碼中當用戶點擊「更多」鏈接時,它會顯示先前隱藏的元素(display:none),更多鏈接消失,顯示「less」鏈接。
在這裏,當我點擊「更多」鏈接它的工作正常意味着它消失並顯示「少」鏈接副版本。但它不顯示/隱藏隱藏的span元素。
此代碼在Chrome,Mozilla和IE7中效果很好,但在IE8中無法使用。代碼有什麼問題。請幫幫我。
感謝ADVANCE。
請分享所有動畫對象爲html –
好的,我更新了我的問題。 – user392406