PROGRESO | WEBESTEEM | ART&DESIGN MAGAZINE 
Forum webesteem Strona Główna webesteem:forum

   Regulamin | Szukaj | Użytkownicy | Grupy | Statystyki | Ostatnie tematy | RSS | Rejestracja | Profil | Skrzynka | Zaloguj

html/JS div - scroll, problem z uciekającym scrollem i wysok

 
Napisz nowy temat   Odpowiedz do tematu    Forum webesteem Strona Główna | html i javascript
Zobacz poprzedni temat :: Zobacz następny temat  
Autor Wiadomość
ruzam




Od: 2010.10.15
Posty: 2

PostWysłany: 2010.10.15 9:50    Temat postu: html/JS div - scroll, problem z uciekającym scrollem i wysok

Witam wszystkich forumowiczów !

Mam poważny problem z okiełznaniem pewnego zadania. Mianowicie po zmniejszeniu okna przeglądarki internetowej scroll dolnego diva "ucieka po za ekran" a po odświeżeniu strony w tym małym rozmiarze scroll nabiera rozmiarów okna. Drugi zaś problem to ramka na górze (fioletowa), po dodaniu jakiejkolwiek zawartości do niej, ramka wchodzi na tego diva na dole. Czy mógłby mi ktoś przerobić ten kod żeby to działało tak jak ma być ? Proszę bardzo o pomoc.
Podaje kod:

Cytat:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>

<script language="javascript">
function GetHeight() {
var y = 0;
if (self.innerHeight) {
y = self.innerHeight;
}
else if (document.documentElement && document.documentElement.clientHeight) {
y = document.documentElement.clientHeight;
}
else if (document.body) {
y = document.body.clientHeight;
}
return y;
}

function Loaded() {
// alert("loaded");
var oHeaderPanel = document.getElementById("headerPanel");
var oPanel = document.getElementById("bodyPanel");
if (oPanel == null ||
oHeaderPanel == null) {
alert(oPanel == null);
alert(oHeaderPanel == null);
return;
}

var iNewHeight = GetHeight() - 200;
oPanel.setAttribute("style", oPanel.getAttribute("style") + "; height:" + iNewHeight + "px;");
}

</script>

<style type="text/css">
body
{
color: black;
background-color: #FFFFFF;
}
.attachmentList
{
float:left;
list-style-type:none;
padding: 0;
margin: 0;
}
.attachmentListItem
{
float:left;
margin-right:10px;
}

.headerTable
{
width: 99%;
border-collapse:collapse;
background-color: #D0D0FF;
position: fixed;
}
td
{
border: solid 1px black;
}
.headerConstFields
{
width: 160px;
}
</style>
</head>
<body onload="Loaded();">
<div id="headerPanel">
<table class="headerTable">
<tr>
<td class="headerConstFields">From:</td>
<td>%from%</td>
</tr>
<tr>
<td class="headerConstFields">To:</td>
<td>%to%</td>
</tr>
<tr>
<td class="headerConstFields">CC:</td>
<td>%cc%</td>
</tr>
<tr>
<td class="headerConstFields">BCC:</td>
<td>%bcc%</td>
</tr>
<tr>
<td class="headerConstFields">Date:</td>
<td>%date%</td>
</tr>
<tr>
<td class="headerConstFields">Title:</td>
<td>%title%</td>
</tr>
<tr>
<td class="headerConstFields">Attachments:</td>
<td>%attachmentList%</td>
</tr>
</table>
</div>

<div id="bodyPanel" style="position:fixed;top:220px; width:99%; height:80%; overflow:scroll;">
<br>dasgjajjjjjjjjjjjjjjjjjjjjjjjjjjjj</br>
<br>dasgjajjjjjjjjjjjjjjjjjjjjjjjjjjjj</br>
<br>dasgjajjjjjjjjjjjjjjjjjjjjjjjjjjjj</br>
<br>dasgjajjjjjjjjjjjjjjjjjjjjjjjjjjjj</br>
<br>dasgjajjjjjjjjjjjjjjjjjjjjjjjjjjjj</br>
<br>dasgjajjjjjjjjjjjjjjjjjjjjjjjjjjjj</br>
<br>dasgjajjjjjjjjjjjjjjjjjjjjjjjjjjjj</br>
<br>dasgjajjjjjjjjjjjjjjjjjjjjjjjjjjjj</br>
<br>dasgjajjjjjjjjjjjjjjjjjjjjjjjjjjjj</br>
<br>dasgjajjjjjjjjjjjjjjjjjjjjjjjjjjjj</br>
<br>dasgjajjjjjjjjjjjjjjjjjjjjjjjjjjjj</br>
<br>dasgjajjjjjjjjjjjjjjjjjjjjjjjjjjjj</br>
<br>dasgjajjjjjjjjjjjjjjjjjjjjjjjjjjjj</br>
<br>dasgjajjjjjjjjjjjjjjjjjjjjjjjjjjjj</br>
<br>dasgjajjjjjjjjjjjjjjjjjjjjjjjjjjjj</br>
<br>dasgjajjjjjjjjjjjjjjjjjjjjjjjjjjjj</br>
<br>dasgjajjjjjjjjjjjjjjjjjjjjjjjjjjjj</br>
<br>dasgjajjjjjjjjjjjjjjjjjjjjjjjjjjjj</br>
<br>dasgjajjjjjjjjjjjjjjjjjjjjjjjjjjjj</br>
<br>dasgjajjjjjjjjjjjjjjjjjjjjjjjjjjjj</br>
<br>dasgjajjjjjjjjjjjjjjjjjjjjjjjjjjjj</br>
<br>dasgjajjjjjjjjjjjjjjjjjjjjjjjjjjjj</br>
<br>dasgjajjjjjjjjjjjjjjjjjjjjjjjjjjjj</br>
<br>dasgjajjjjjjjjjjjjjjjjjjjjjjjjjjjj</br>
<br>dasgjajjjjjjjjjjjjjjjjjjjjjjjjjjjj</br>
<br>dasgjajjjjjjjjjjjjjjjjjjjjjjjjjjjj</br>
<br>dasgjajjjjjjjjjjjjjjjjjjjjjjjjjjjj</br>
<br>dasgjajjjjjjjjjjjjjjjjjjjjjjjjjjjj</br>
<br>dasgjajjjjjjjjjjjjjjjjjjjjjjjjjjjj</br>
<br>dasgjajjjjjjjjjjjjjjjjjjjjjjjjjjjj</br>
<br>dasgjajjjjjjjjjjjjjjjjjjjjjjjjjjjj</br>
dasgjajjjjjjjjjjjjjjjjjjjjjjjjjjjj
<div>%body%</div>
<br />
<div style="background:#F0F0B0;">%attachments%</div>
</div>
</body>
</html>


z góry dziękuję.




EDIT:
problem pierwszy (z uciekającym scrollem rozwiązany). teraz tylko potrzebuje pomocy przy najeżdzaniu tabelki przy powiększaniu na dolnego diva.
^
Odpowiedz z cytatem
Soviet




Od: 2010.08.06
Posty: 6

PostWysłany: 2010.10.15 20:01    Temat postu:

U mnie wszystko działa dobrze?
^
Odpowiedz z cytatem
ilovecss




Od: 2009.07.13
Posty: 179
Skąd: from /b/

PostWysłany: 2010.10.15 20:35    Temat postu: Re: html/JS div - scroll, problem z uciekającym scrollem i w

ruzam napisał(a):

EDIT:(...)

Nice try.., na tym forum nie ma editów.

1.) Jak powiększasz dynamicznie tabelę[o to chodzi w tym, "dodawaniu"?], to nic dziwnego, że nachodzą na siebie - tak to ustawiłeś w js

2.) co to w ogóle jest/ma być?

3.) Pod czym ma działać?

4.) KISS, po co atakować to javascriptem, skoro zwykły css wystarczy?

Edit: ZOMG, edit ^^
^
Odpowiedz z cytatem
ruzam




Od: 2010.10.15
Posty: 2

PostWysłany: 2010.10.18 10:54    Temat postu:

powiem tak, cały ten problem już rozwiązałem ale dziękuję bardzo za chęci, teraz pojawił się inny problem - to autodopasowanie do okna przeglądarki działa na każdej z wyjątkiem IE 9 beta. czy to jest jakiś chwilowy błąd z strony IE czy do kodu musze coś dopisać ?
^
Odpowiedz z cytatem
Wyświetl posty z ostatnich:   
Napisz nowy temat   Odpowiedz do tematu    Forum webesteem Strona Główna | html i javascript Wszystkie czasy w strefie EET (Europa)
Strona 1 z 1

 
Skocz do:  
Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach

FAQ


serwery wirtualne, tanie domeny

Powered by phpBB © 2001, 2005 phpBB Group

90315809

Page generation time: 0.0322s (PHP: 87% - SQL: 13%) - SQL queries: 14 - GZIP enabled - Debug off