开发者

My popups are at bottom:0; but after you hover over them 2-3 times they keep going up?

My blog has these popups, and they are at bottom 0. But when you hover over them twice or more times they begin to go up farther each time you hover. Any way to prevent?

Edit: The reason it's doing this is because each time it hovers, the "bottom" resets so it's going -10px from where it l开发者_开发百科ast was. I don't know how to stop this.

Answer: I added info.css("bottom', '-10px'); and that fixed it. Thanks to all who answered, though.


Are you setting the position on rollover? If so, try setting the position at load and just turning the display on/off at mouseover/mouseout.


You'll have to add position:absolute to the style of the popup


In your javascript, change:

bottom: '-=' + distance,

to

bottom: '+=' + distance,

On mouse over you are subtracting -10 pixels to the distance from the bottom. On mouse out, you need to add those -10px.

Sorry for the mix up earlier, I got confused about adding negative numbers.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜