|
|
|
| Здравствуйте. Хотелось бы, что бы таблица оставалась на одном месте во время прокрутки страницы (в левом верхнем углу), но при этом чтоб, если такое возможно, не залазила на Хедер (на шапку страницы.) Подскажите пожалуйста, а то с изображениями знаю как сделать а с таблицей не получается....
<tr >
<td ><?php /*Вывод Строчек центр. таблицы в цикле*/
$result2 = mysql_query("SELECT name,nazvan FROM razdel ORDER BY id",$db);
echo "<table width='83%' cellspacing='0' >";
while ($myrow2 = mysql_fetch_assoc($result2))
{
echo "<td class='left1' width='83%' style=\"background:#00006A\"
onmouseover=\"this.style.background = '#CCCCCC'; this.firstChild.style.color = '#FF4900';\"
onmouseout =\"this.style.background = '#00006A'; this.firstChild.style.color = '#CCCCCC';\"
><a style=\"color: #CCCCCC\" class='left' href=index.php#{$myrow2['name']}>$myrow2[nazvan]</a></td>
</tr>";
}
echo "</table>";
?>
</td>
</tr>
|
| |
|
|
|
|
|
|
|
для: Dinya_1
(30.10.2008 в 18:12)
| | ну юзни <div>
вообще в таких случая юзается position:fixed;
но в ИЕ он не работает... как по другому не знаю) | |
|
|
|
|
|
|
|
для: sl1p
(30.10.2008 в 18:35)
| | Нужны еще варианты.... | |
|
|
|
|
|
|
|
для: Dinya_1
(30.10.2008 в 18:49)
| | Вот вам раз пример на CSS:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
html, body {
padding:0;
margin:0;
width:100%;
height:100%;
overflow:hidden;
}
#position_fixed {
width:200px;
height:200px;
background:#f00;
position:absolute;
top:50px;
left:100px;
z-index:1;
}
#template {
position:relative;
width:100%;
height:100%;
overflow:auto;
}
</style>
</head>
<body>
<div id="position_fixed"></div>
<div id="template">
<div id="inner">
мног-много текста
<div style="height:1500px">1</div>
и еще немного
</div>
</div>
</body>
</html>
|
| |
|
|
|
|
|
|
|
для: Madman
(30.10.2008 в 19:05)
| | Спасибо -Madman ! , :)) | |
|
|
|
|
|
|
|
для: Dinya_1
(30.10.2008 в 18:49)
| | Вот вам два пример с expression:
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
html, body {
padding:0;
margin:0;
width:100%;
height:100%;
}
body {
background:url(spacer.gif) fixed;
}
#position_fixed {
width:200px;
height:200px;
background:#f00;
position:fixed;
top:50px;
left:100px;
z-index:1;
}
* html #position_fixed {
position:absolute;
top: expression(document.getElementsByTagName("body")[0].scrollTop + 50 + "px");
}
#template {
position:relative;
}
</style>
</head>
<body>
<div id="position_fixed"></div>
<div id="template">
<div id="inner">
мног-много текста
<div style="height:1500px">1</div>
и еще немного
</div>
</div>
</body>
</html>
|
Минус этого метода - требует QuirksMode для IE6 | |
|
|
|
|
|
|
|
для: Madman
(30.10.2008 в 19:20)
| | Немного пораскинув мозгами, сделал вариант с expression для любого режима ИЕ6.
Пример с expression для любого режима IE6:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
html, body {
padding:0;
margin:0;
width:100%;
height:100%;
}
body {
background:url(spacer.gif) fixed;
}
#position_fixed {
width:200px;
height:200px;
background:#f00;
position:fixed;
top:50px;
left:100px;
z-index:1;
}
* html #position_fixed {
position:absolute;
top: expression( ( (document.documentElement && document.documentElement.scrollTop) ? parseInt(document.documentElement.scrollTop) : document.body.scrollTop ? parseInt(document.body.scrollTop) : 0 ) + 50 + 'px');
}
#template {
position:relative;
}
</style>
</head>
<body>
<div id="position_fixed"></div>
<div id="template">
<div id="inner">
мног-много текста
<div style="height:1500px">1</div>
и еще немного
</div>
</div>
</body>
</html>
|
| |
|
|
|
|
|
|
|
для: Madman
(04.11.2008 в 15:41)
| | И еще немного пораскинув и попросьбе из темы тык.
Зафиксирован и прижат книзу вне зависимости от размеров рабочей области браузера:
1) Для варианта на CSS - просто меняем top:0 на bottom:0
2) Вариант с expression:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
html, body {
padding:0;
margin:0;
width:100%;
height:100%;
}
body {
background:url(spacer.gif) fixed;
}
#position_fixed {
width:200px;
height:200px;
background:#f00;
position:fixed;
bottom:0;
left:100px;
z-index:1;
}
* html #position_fixed {
position:absolute;
bottom:auto;
top: expression( ( (document.documentElement && document.compatMode && (document.compatMode != 'BackCompat')) ? parseInt(document.documentElement.scrollTop) + document.documentElement.clientHeight : parseInt(document.body.scrollTop) + document.body.clientHeight ) - this.clientHeight + 'px');
}
#template {
position:relative;
}
</style>
</head>
<body>
<div id="position_fixed"></div>
<div id="template">
<div id="inner">
мног-много текста
<div style="height:1500px">1</div>
и еще немного
</div>
</div>
</body>
</html>
|
| |
|
|
|