DHTML

Moving Background
Moving Objects
Rollover
Pulldown Menu
Preloading
Drag'n'Drop
Scrolling Text
Teletype
Shoot Me!
Animation
ActiveX
Opacity
Transition
Mad Bubbles
Gates

JavaScript


Books

Russian | Main Page


Useful links: Ideas for granite countertop edges.





Moving Background | Description

If you want to use any of this examples, please put a link to our site.
Here you can find HTML-code for such link.

<html>
<head>
<title>www.redmount.com - DHTML - Moving Background</title>
</head>
<script language="javascript">
<!--
  //global variables
  var topStopPoint="null",layerRef="null",styleSwitch="null",currtop=-100;
  function init()
  {
    layerRef="document.all";
    styleSwitch=".style";
    topStopPoint="-40px";
    moveLayerTo('movingBG');
  }
// -->
</script>

<style type="text/css">
#movingBG {position: absolute; z-index: 10; visibility: visible; left: 0px; top: 0px;}
#text {position: absolute; z-index: 20; visibility: visible; left: 15px; top: 15px;}
</style>

<body bgcolor="Black" text=white vlink=silver onLoad=init() link=yellow vlink=white> 
<script language=javascript>
<!--
  function moveLayerTo(layerName)
  { 
    if (eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.top != topStopPoint'))
    {
      currtop+=2;
      eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.top = currtop');
      setTimeout('moveLayerTo("'+layerName+'")',20);
    }
    else
    {
      currtop=-196;
      eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.top = currtop');
      setTimeout('moveLayerTo("'+layerName+'")',20);
    }
  } 
//-->
</script>

<div id="text">Text</div>
<div id="movingBG">
<table width="100%" border="0" background="snow.gif" height="11500">
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
</div>
</body>
</html>