2012-05-30 2 views
0

проблема div, называемая «dragger_container», doe't ведет себя так, как я ожидаю, и выходит из родительского div. это неприемлемо, потому что это элемент, который показывает прогресс прокрутки пользователя (это плагин jQuery mCustomScrollBar) и взаимодействует с пользователем.
спросите любого о помощи.
заранее спасибокак применять положение css: абсолютно правильно?

пс не может прикрепить экран причину репутации, загрузив его здесь: screen_url

.mcs_my_container 
{ 
width: 100%; 
height: 100%; 
} 

.mcs_my_container .customScrollBox 
{ 
margin-top: 10px; 
position: relative; 
height: 80%; 
width: 100%; 
overflow:hidden; 
border: 1px solid green; 
display: block; 
} 

.mcs_my_container .customScrollBox .container 
{ 
position: absolute; 
width: 70%; 
top: 0; 
float: left; 
margin-left: 20px; 
} 

.mcs_my_container .customScrollBox .content 
{ 
clear: both; 
} 

.mcs_my_container .dragger_container 
{ 
position: absolute; 
/*top: 10px !important;*/ 
width: 2px; 
/*height: 50px;50px 
height: 100%;*/ 
height: 110px; 
top: 0px; 
right: 20px; 
float: right; 
background: #000; 
cursor: s-resize; 
-moz-border-radius: 2px; 
-khtml-border-radius: 2px; 
-webkit-border-radius: 2px; 
border-radius: 2px; 
cursor: s-resize; 
} 

.mcs_my_container .dragger 
{ 
position: absolute; 
width: 4px; 
/*height: 100%;*/ 
height: 10px;/* !important;*/ 
background: #999; 
text-align: center; 
line-height: 10px; 
color: #666; 
overflow: hidden; 
cursor: pointer; 
-moz-border-radius: 2px; 
-khtml-border-radius: 2px; 
-webkit-border-radius: 2px; 
border-radius: 2px; 
margin-left: -1px; 
} 

.mcs_my_container .dragger_pressed 
{ 
position: absolute; 
width: 6px; 
margin-left: -2px; 
height: 10px; 
background: #999; 
text-align: center; 
line-height: 10px; 
color: #666; 
overflow: hidden; 
-moz-border-radius: 4px; 
-khtml-border-radius: 4px; 
-webkit-border-radius: 4px; 
border-radius: 4px; 
cursor: s-resize; 
} 

.divNoteText 
{ 
position: static; 
border: 1px solid red; 
word-wrap: break-word; 
} 
+1

Просто введите свой код здесь, http://jsfiddle.net/ –

+0

, чтобы иметь подсветку синтаксиса или отладки? – user1200752

ответ

1

Вам нужно добавить position: relative в родительский контейнер dragger_container, что вы хотите, чтобы находиться в пределах ,

Если вы этого не сделаете, то dragger_container будет позиционироваться абсолютно к ближайшему родительскому элементу, который расположен относительно, или если он отсутствует, то он будет расположен в пределах body.

Смежные вопросы