【发布时间】:2012-11-23 12:00:13
【问题描述】:
我刚刚写了一个简单的滑块。但是有一些奇怪的东西,我无法解决它。该脚本适用于 firefox (12) 而不是; 克罗姆 (23.0.1271.64 m), 歌剧(12.02), 即(7-8-9-D), 野生动物园(5.1.7)。
这是下面的代码。谁能告诉我如何解决?
jsfiddle code.
$.fn.etkinlikslide = function() {
var etkinlikid = this.selector.replace(/\#/g,'');
var esheight = parseInt($('#'+etkinlikid).height());
var epheight = parseInt($('#etkinlikpanel').height());
function oynat(){
var topcheck =parseInt($('#'+etkinlikid).css("top"))+parseInt($('#'+etkinlikid).height());
if (topcheck<0) $('#'+etkinlikid).css("top",$('#etkinlikpanel').css("height"));
$('#'+etkinlikid).css("top",parseInt($('#'+etkinlikid).css("top"))-1+'px');
}
if (esheight>epheight) {
var etkinliktimer = window.setInterval(function() {oynat()}, 80);
$('#'+etkinlikid).hover(function(){
window.clearInterval(etkinliktimer);
},function(){
etkinliktimer = window.setInterval(function() {oynat()}, 80);
});
}
};
$("#etkinlikslide").etkinlikslide();
【问题讨论】:
-
你能详细说明问题是什么吗?
-
#etkinlikslide div 应该向上滑动,但它仅适用于 firefox。
标签: jquery internet-explorer firefox google-chrome