Forum Webmastera, HTML, CSS, PHP, MySQL, Hosting, Domeny - Forum dla Webmasterów
OVERFLOW chyba... - Wersja do druku

+- Forum Webmastera, HTML, CSS, PHP, MySQL, Hosting, Domeny - Forum dla Webmasterów (https://www.webmastertalk.pl)
+-- Dział: Technologie internetowe - tworzenie stron WWW (https://www.webmastertalk.pl/forum-technologie-internetowe-tworzenie-stron-www)
+--- Dział: xHTML, CSS, JavaScript (https://www.webmastertalk.pl/forum-xhtml-css-javascript)
+--- Wątek: OVERFLOW chyba... (/thread-overflow-chyba)



OVERFLOW chyba... - zubol - 04-08-2009

Witam,

Czy ktos z was wie moze jak rozwiazac taki problem:

Mam DIV'a i tabelke ze scrollami (X i Y), potem dynamicznie tworze nowego DIV'a z tekstem ktory ma ustawione position:absolute (zeby mogl sie znalezc np. w 2 komorkach albo 1,5 itp.)
Chcialbym aby nowy DIV przesuwal sie razem z tabelka oraz co najwazniejsze (nie moge sobie z tym poradzic) gdy nowy DIV dojdzie do konca/poczatku tabelki dzialalo overflow:hidden.

Kod:
Kod:
<div style="width:250px;height:200px;overflow-y:auto;overflow-x:auto;border:1px solid black;">
        <table cellpadding="4" cellspacing="1" width="100%" border="1px">
            <tr>
                <td><span style="color:black;">
                        test test test test test test test test test test test test
                    </span>
                </td>
                <td>
                    dfadsfdsafdsferyhfg gfh fgjhdf
                </td>
            </tr>
            <tr>
                <td><span style="color:black;">
                        test test test test test test test test test test test test test test test
                    </span>
                </td>
                <td>
                    dfads fdsafd sferyhfg gfh fgjhdf
                </td>
                <td></td>
            </tr>
            <tr>
                <td><span style="color:black;">
                        test test test test test test test test test test test test
                    </span>
                </td>
                <td>
                    dfadsf dsaf dsferyhfg gfh fgjhdf
                </td>
                <td></td>
            </tr>
            <tr>
                <td><span style="color:black;">
                        test test test test test test test test test test test test test test test
                    </span>
                </td>
                <td>
                    dfadsfdsafdsferyhfg gfh fgjhdf
                </td>
                <td></td>
            </tr>
       </table>
       <div style="border: 1px solid #008000; position: absolute; width: 97px; height: 20px;
            top: 18px; left: 13px; background-color: #008000; overflow: hidden; z-index: 1;">
        123 proba
       </div>
    </div>

Co zrobic zeby 123 proba przesowalo sie wraz z zawartoscia tabelki?

Dzieki za pomoc,
Michal.


RE: OVERFLOW chyba... - Labsta.com - 04-08-2009

Tabela musi miec position:relative; w ten sposób staje się punktem odniesienia dla position:absolute;


RE: OVERFLOW chyba... - zubol - 04-08-2009

Dzieki za odpowiedz.
Jednak gdy dodalem do naglowka tabeli style="position: relative"
wszystko sie rozjechalo i to jak Smile


RE: OVERFLOW chyba... - Labsta.com - 04-08-2009

hmmm
to obejmij tabelę i tego diva (co ma się poruszać) jeszcze jednym divem i daj mu style="position: relative;"


RE: OVERFLOW chyba... - zubol - 04-08-2009

Teraz dziala Smile WIelkie dzieki o to dokladnie mi chodzilo