最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin1浏览0评论

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;
}
发布评论

评论列表(0)

  1. 暂无评论