javascript - fix the position of fancybox on screen? scroll true? - Stack Overflow

I want to do a couple of things in fancy box - >I am using it to fire an AJAX function,the recieved

I want to do a couple of things in fancy box - > I am using it to fire an AJAX function,the recieved content from server, little problem is ->

1. It is not auto scrolling, am getting a scroll and am able to scroll but cannot scroll it using the touchpad.

2. i want to fix the position of it on the screen, it is moving if i scroll the page in backgroung.

Following is some CSS code, help me what to add in it.

width:720px;
height:380px;
float:left;
overflow-y:scroll;

Thanks :)

I want to do a couple of things in fancy box - > I am using it to fire an AJAX function,the recieved content from server, little problem is ->

1. It is not auto scrolling, am getting a scroll and am able to scroll but cannot scroll it using the touchpad.

2. i want to fix the position of it on the screen, it is moving if i scroll the page in backgroung.

Following is some CSS code, help me what to add in it.

width:720px;
height:380px;
float:left;
overflow-y:scroll;

Thanks :)

Share Improve this question edited Aug 23, 2011 at 13:29 Reporter 3,9365 gold badges35 silver badges49 bronze badges asked Aug 23, 2011 at 13:28 saurabhsaurabh 111 silver badge2 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 3

Try adding this to your css

body #fancybox-wrap { position: fixed; }

It is necessary to set also a top distance, otherwise Fancybox calculates it from the top and if the container is fixed it will go out of the screen.

Furthermore, it is necessary to set it as !important in order to overwrite inline css:

#fancybox-wrap {
    top: 100px !important;
}

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745275529a4620016.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信