cuốn sách gpt4 ai đã làm

javascript - 使用 .animate( {'height' :'toggle' }) 时出现奇怪的 IE8 问题

In lại Tác giả: Walker 123 更新时间:2023-11-28 16:36:29 26 4
mua khóa gpt4 Nike

Kiểm trahttp://wouter.howafarms.com/faq

目标是点击即可展开答案。
正如您将看到的,这在除 ie8 之外的所有浏览器中都能完美运行。

我尝试了各种动画效果.slideDown()、.toggle(),但没有效果。它们总是可以在 Firefox、Chrome 甚至 IE7 中运行,但不能在 IE8 中运行。到底是什么原因造成的。

这是 JavaScript:

$(document).ready(function() {
$("#faq-list li").addClass('inactive');
$("#faq-list li").first('.inactive').toggleClass('inactive');
$("#faq-list li h2").toggle(
chức năng(){
$(this).parent().find('.answer').animate({'height': 'toggle'},{queue:true,duration:300})
$(this).toggleClass('inactive')
} ,
chức năng() {
$(this).parent().find('.answer').animate({'height': 'toggle'},{queue:true,duration:300})
$(this).toggleClass('inactive')
})

})

câu trả lời hay nhất

我不知道为什么,但是 h2 元素上的 hiển thị: nội tuyến (问题)是折叠在 ie8 中无法正常工作的原因。删除它就可以了。只需重新设置“q”的样式,使其对齐

关于javascript - 使用 .animate( {'height' :'toggle' }) 时出现奇怪的 IE8 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3713540/

26 4 0
Chứng chỉ ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com
Xem sitemap của VNExpress