Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <style type"text/css">
- #napis
- {
- position: absolute;
- background-color: #3ff;
- width: 210px;
- float: left;
- }
- #napis1
- {
- position: absolute;
- background-color: #3ff;
- width: 210px;
- float: right;
- }
- </style>
- <script type="text/javascript">
- function Animacja()
- {
- var blok = document.getElementById('napis');
- if (parseInt(blok.style.left) < 5)
- {
- blok.style.left= "1000px";
- }
- else
- {
- blok.style.left =(parseInt(blok.style.left) - 3)+"px";
- }
- }
- window.setInterval("Animacja()",10)
- function Animacja2()
- {
- var blok1 = document.getElementById('napis1');
- if (parseInt(blok1.style.right) < 5)
- {
- blok1.style.right= "1000px";
- }
- else
- {
- blok1.style.right =(parseInt(blok1.style.right) - 3)+"px";
- }
- }
- window.setInterval("Animacja2()",10)
- </script>
- </head>
- <body>
- <div id="napis" style="left: 300px;">JavaScript -język skryptowy:-)</div><br>
- <div id="napis1" style="right: 300px;">JavaScript -język skryptowy:-)</div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement