开发者

Why does jQuery slide right or left overshoots the final left position the re-adjust?

I created a hidden DIV panel with form fields in it. I setup an icon on a nav bar on the right side of the page. When clicking on that icon, I perform a show('slide', { direction: right }, 2000). Although the animation starts properly, jQuery overshoots the left boundary then eventually reposition the panel correctly.

Why does this happen? Is there a work-around?

(PS - I figured out th开发者_JAVA百科e issue and answer - will post tomorrow!)


This can be overcome with some css. The main pieces to stop it from pushing past the left & right edge are below. You will need to do more to get it to fit inside vertically, and you might need to change the amount of padding depending on the width of your handle.

.ui-slider{
  padding-left: 5px;
  padding-right: 5px;
  height:15px;
}

.ui-slider a{
  position:relative;
  display:block;
  top:0;
  height:15px;
  width:10px;
  margin-left:-5px;
  border:none;
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜