ロゴ付きのリストを含むdivを連続的に上下に移動するjqueryコードがあります。アニメーションは設定された間隔内で繰り返され、Chrome、FireFox、IE 9および8ですべて期待どおりに機能しているようです(コンソールエラーはありません)。
ただし、IE7では「スクリプトエラー」が発生し、ブラウザが完全にフリーズします... setIntervalとclearIntervalが正しく機能していないか、コードが台無しになっていると思います...
ここにあります:
//<!------------------LOGOS ------------------>
// the automatic scroll start immediately
$(document).ready(function () { membersLogos() });
// set the interval after which to restart the animated scroll
$(function () {
var intervalID;
var resetTimer = function () {
if (intervalID) { clearInterval(intervalID) };
intervalID = setInterval(function () {
membersLogos();
}, 190000);
};
});
// set the interval after which to restart the animated scroll
function membersLogos() {
var pane = $('#mypane');
if ($('#mypane').length) {
pane.jScrollPane({
animateScroll: true, //added
animateDuration: 95000, //added - length each way in milliseconds
stickToTop: true,
//autoReinitialise: true,
enableKeyboardNavigation: true
});
var api = pane.data('jsp');
var logosHeight = parseInt($('#mypane .jspPane').height());
//listen to the x-axis scrolling event
pane.bind('jsp-scroll-y', function (event, pos_y, at_top, at_bottom) {
//we're at the bottom now lets scroll back to the top
if (at_bottom) {
api.scrollToY(0);
$(this).unbind(event); //added with edit
$(this).bind('jsp-scroll-y', function (event, pos_y, at_top, at_bottom) {
if (at_top) {
$(this).unbind(event);
api.scrollToY(logosHeight);
}
});
}
});
//initial animate scroll to the top
api.scrollToY(logosHeight);
}
}
何が悪いのかというアイデアや提案はありますか?前もって感謝します!Vik