Scroll 高速滑动,自动跟随滚动
我正在为此寻找修复/解决方案,并找到了以下主题: 在论坛主题上有一个小漏洞,但这个漏洞在我尝试过的任何Internet Explorer(IE7、IE8和IE9)上都不起作用 有没有人对黑客有“修复”来让它在IE上工作 我认为这与代码的这一部分有关,这个条件: 如果(!hs.ie | | hs.ieVersion()>6) 我删除了它,它工作了,但也许这个代码可以更改Scroll 高速滑动,自动跟随滚动,scroll,highslide,Scroll,Highslide,我正在为此寻找修复/解决方案,并找到了以下主题: 在论坛主题上有一个小漏洞,但这个漏洞在我尝试过的任何Internet Explorer(IE7、IE8和IE9)上都不起作用 有没有人对黑客有“修复”来让它在IE上工作 我认为这与代码的这一部分有关,这个条件: 如果(!hs.ie | | hs.ieVersion()>6) 我删除了它,它工作了,但也许这个代码可以更改 谢谢。下面的代码就是您所需要的。现场演示: 注意:需要highslide-full.js // Highslide f
谢谢。下面的代码就是您所需要的。现场演示:
注意:需要highslide-full.js
// Highslide fixed popup mod. Requires the "Events" component.
if (!hs.ie || hs.uaVersion > 6) hs.extend ( hs.Expander.prototype, {
fix: function(on) {
var sign = on ? -1 : 1,
stl = this.wrapper.style;
if (!on) hs.getPageSize(); // recalculate scroll positions
hs.setStyles (this.wrapper, {
position: on ? 'fixed' : 'absolute',
zoom: 1, // IE7 hasLayout bug,
left: (parseInt(stl.left) + sign * hs.page.scrollLeft) +'px',
top: (parseInt(stl.top) + sign * hs.page.scrollTop) +'px'
});
if (this.outline) {
stl = this.outline.table.style;
hs.setStyles (this.outline.table, {
position: on ? 'fixed' : 'absolute',
zoom: 1, // IE7 hasLayout bug,
left: (parseInt(stl.left) + sign * hs.page.scrollLeft) +'px',
top: (parseInt(stl.top) + sign * hs.page.scrollTop) +'px'
});
}
this.fixed = on; // flag for use on dragging
},
onAfterExpand: function() {
this.fix(true); // fix the popup to viewport coordinates
},
onBeforeClose: function() {
this.fix(false); // unfix to get the animation right
},
onDrop: function() {
this.fix(true); // fix it again after dragging
},
onDrag: function(sender, args) {
//if (this.fixed) { // only unfix it on the first drag event
this.fix(true);
//}
}
});
你提供的那个网站在IE 8.0.6001中运行得非常好。对不起,我写了很多,你误解了。删除了链接。问题是,这个黑客应该让Highslide保持固定,而不是跟随滚动移动。黑客对我来说在任何IE版本上都不起作用:(,我对原来的问题做了一些修改。谢谢你能在你的网站上提供关于这个问题的例子吗?非常感谢。在我测试的所有浏览器上都很好。Chrome、Firefox、Safari和IE7、IE8和IE9.)Thanks@RoadRash,此代码中有一个错误。当页面滚动未完全到达顶部时尝试拖动,拖动时被拖动的元素将跳转。也可在您提供的演示链接中复制。
// Highslide fixed popup mod. Requires the "Events" component.
if (!hs.ie || hs.uaVersion > 6) hs.extend ( hs.Expander.prototype, {
fix: function(on) {
var sign = on ? -1 : 1,
stl = this.wrapper.style;
if (!on) hs.getPageSize(); // recalculate scroll positions
hs.setStyles (this.wrapper, {
position: on ? 'fixed' : 'absolute',
zoom: 1, // IE7 hasLayout bug,
left: (parseInt(stl.left) + sign * hs.page.scrollLeft) +'px',
top: (parseInt(stl.top) + sign * hs.page.scrollTop) +'px'
});
if (this.outline) {
stl = this.outline.table.style;
hs.setStyles (this.outline.table, {
position: on ? 'fixed' : 'absolute',
zoom: 1, // IE7 hasLayout bug,
left: (parseInt(stl.left) + sign * hs.page.scrollLeft) +'px',
top: (parseInt(stl.top) + sign * hs.page.scrollTop) +'px'
});
}
this.fixed = on; // flag for use on dragging
},
onAfterExpand: function() {
this.fix(true); // fix the popup to viewport coordinates
},
onBeforeClose: function() {
this.fix(false); // unfix to get the animation right
},
onDrop: function() {
this.fix(true); // fix it again after dragging
},
onDrag: function(sender, args) {
//if (this.fixed) { // only unfix it on the first drag event
this.fix(true);
//}
}
});