在JavaScript编码方面,我是新手。我正在尝试为每张幻灯片自定义高级滑块插件(http://codecanyon.net/item/advanced-slider-jquery-xml-slider/132618),其动态高度。我想在每次用户观看另一张幻灯片时触发一个事件。请参阅我的演示页面:http://josephespana.com/hughesnet/videos-v2.html
$(document).ready(function() {
var thisHeight = $('.active').height() + 100;
//Adjusts height on first load
$('#responsive-slider').animate({ height: (thisHeight + 'px') }, 500, 'swing');
//Adjusts height while clicking through slides
$('#responsive-slider a').click(function() {
var thisHeight = $('.active').height() + 100;
//Modern browsers
$('#responsive-slider').animate( { height: (thisHeight + 'px') }, 500, 'swing');
});
});
这适用于所有现代浏览器,但令我惊讶的是,这不适用于IE8。任何帮助,将不胜感激。谢谢!