1

I'm having problem with colorbox when loading content first time after opening the page. I was making a list of people with button description for each person. after pressing a button opens a colorbox "window" with info that is taken from db according to person_id in address tab. so it loads a content from another section of page. List is in index.php?page=list and description link is index.php?page=list&person_id (opens different file). In that other file is mysql query etc and info is taken form db and then echo'ed.. so do div(div is not in db). div has css class:

.see_profile {
    background-color:#ececec;
    width:400px;
    height:auto;
    overflow:auto;
    padding:30px;
    font-size:14px;
    text-align:justify
}

Information is in the div. When I open page and press description button, it opens colorbox but box has srollers on the bottom and right side. after closing box and opening it again srollers are gone.. Couldn't figure it out what is the problem.. Chrome, FF and Opera have this problem except IE6.

In header I have:

<script type="text/javascript">
    $(document).ready(function(){
    $(".member").colorbox();
    });
</script>

I also noticed that it happens after inserting image in the div

4

1 回答 1

0

我已经调查了这个问题。

尝试查看您通过 ajax 加载的内容。如果它有一些没有“高度”和“宽度”属性的图像,则可以出现滚动条。

发生这种情况是因为浏览器不知道图像的大小,也不会等到它加载后才计算页面布局。第一次加载后,图像在缓存中,浏览器可以计算大小。

尝试为您的图像指定尺寸。对我来说它有效。

于 2011-01-26T11:56:26.417 回答