Jump to content
php.lv forumi

Slidošs banner


sayed

Recommended Posts

nu nav neviena vai?

 

Atrašanās vieta jāmaina 2x vietās, iekš <img> absolūto vietu un javascriptam sākumā mainīgajiem flleft un fltop.

Ar <img> palīdzību atrašanās vieta tiek inicializēta, ar mainīgo palīdzību viņa tiek saglabāta kad scrollo lapu.

<html>
<head>
<title>test</title>
</head>
<body onscroll="updatepos();">
<img src="http://img.tomshardware.com/design/op/overclocking/ban_336x100_us.jpg"
id="flimg" name="flimg" style="position:absolute;left:200px;top:10px;">
test<br>
dfsafsadghjklhdsfdsaklfj<br>
akhgdljshfkdsjfkdsajfl;<br>
test<br>
dfsafsadghjklhdsfdsaklfj<br>
akhgdljshfkdsjfkdsajfl;<br>
test<br>
dfsafsadghjklhdsfdsaklfj<br>
akhgdljshfkdsjfkdsajfl;<br><br>test<br>
dfsafsadghjklhdsfdsaklfj<br>
akhgdljshfkdsjfkdsajfl;<br>
test<br>
dfsafsadghjklhdsfdsaklfj<br>
akhgdljshfkdsjfkdsajfl;<br>
test<br>
dfsafsadghjklhdsfdsaklfj<br>
akhgdljshfkdsjfkdsajfl;<br>
test<br>
dfsafsadghjklhdsfdsaklfj<br>
akhgdljshfkdsjfkdsajfl;<br>
test<br>
dfsafsadghjklhdsfdsaklfj<br>
akhgdljshfkdsjfkdsajfl;<br>
test<br>
dfsafsadghjklhdsfdsaklfj<br>
akhgdljshfkdsjfkdsajfl;<br>
test<br>
dfsafsadghjklhdsfdsaklfj<br>
akhgdljshfkdsjfkdsajfl;<br>
test<br>
dfsafsadghjklhdsfdsaklfj<br>
akhgdljshfkdsjfkdsajfl;<br>
test<br>
dfsafsadghjklhdsfdsaklfj<br>
akhgdljshfkdsjfkdsajfl;<br>
test<br>
dfsafsadghjklhdsfdsaklfj<br>
akhgdljshfkdsjfkdsajfl;<br>
<script type="text/javascript">
<!--
var flleft = 200;
var fltop = 10;
function updatepos(){
var brwscrolll = document.body.scrollLeft;
var brwscrollt = document.body.scrollTop;
document.getElementById('flimg').style.left = brwscrolll + flleft;
document.getElementById('flimg').style.top = brwscrollt + fltop;
}
-->
</script>
</body></html>

 

Hope it helps.

Link to comment
Share on other sites

Maziņš update, lai būtu apakšā un lai tavs baneris slīd, testēju uz IE7&FF3, vajdzētu strādāt.

 

To <img> var dzēst nost augšā. Apakšā jāizskatās ~ šādi:

...
akhgdljshfkdsjfkdsajfl;<br>
<marquee width="100%" style="position:absolute;bottom:10px;" id="flimg" name="flimg">
<img src="http://img.tomshardware.com/design/op/overclocking/ban_336x100_us.jpg">
</marquee>
<script type="text/javascript">
<!--
var flbottom = 10;
var flheight = 100;
function updatepos(){
var brwscrolll = document.body.scrollLeft;
var brwscrollt = document.body.scrollTop;
var brwwind = document.body.clientHeight;
document.getElementById('flimg').style.left = brwscrolll;
document.getElementById('flimg').style.top = brwscrollt + brwwind - flheight - flbottom;
}
-->
</script>
</body></html>

Link to comment
Share on other sites

×
×
  • Create New...