Webmaster Genel Forumları kategorimiz yenilendi!
SMF 2.0 sürümleri için yeni modül/eklentiler sitemizde! İlgili kategorilere gözatabilirsiniz.
Linkleri goruntulemenize izin verilmiyor. Kayit olun veya Giris yapin
Linkleri goruntulemenize izin verilmiyor. Kayit olun veya Giris yapin
Hoşgeldiniz Ziyaretçi. Lütfen giriş yapın veya kayıt olun
Tarih/Saat: 18 Mayıs 2012, 13:34:22
Sayfa: [1] Yazdır
Gönderen Konu: Çok Güzel Javascript Ama... ?  (Okunma sayısı 778 defa)
Yeni Üye
*
İleti: 1
Teşekkür Sayısı: 0
Çevrimdışı Çevrimdışı
Cinsiyet: Bay
E-Posta
« : 30 Mart 2009, 16:37:54 »


Selamün aleyküm arkadaşlar. Ben bir okul sitesi için çalışmalara başladım. Araştırmalarım sonucunda bazı şeyler buldum. Elimde 4 adet 832 X 250 pixel boyutunda logo var. Bunlar sırasıylar ayarlandığı saniyede sola doğru kayıyor. Yani kodun yaptığı işbu. Ama kod 430 X 70 pixel için ayarlanmış. Ben uğraştım faka yapamadım lütfen bir yardım edin. Kodlar veriyorum.

Kod: Linkleri goruntulemenize izin verilmiyor. Kayit olun veya Giris yapin
<HEAD>

<style type="text/css">
<!--
#addbox {
  position: relative;
  width: 500px;
  height: 70 px;
  clip: rect(0px, 500px, 0px, 70px);
  overflow: hidden;
}
#banner1 {
  position: relative;
  width: 480px;
  height: 60px;
  left: 0;
  top: 5px;
}
#banner2 {
  position: relative;
  width: 480px;
  height: 60px;
  left: 500px;
  top: -55px !important;
  top:-58px;
}
-->
</style>

<script type="text/javascript">
<!--
/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Ben Kanaev :: http://www.webhostreview.biz
Adaptation for Netscape and Firefox by Fang */

var displayTime, speed, wait, banner1, banner2, link1, link2, bannerIndex, bannerLocations, bannerURLs;

function initVar() {
  displayTime = 10; // The amount of time each banner will be displayed in seconds.
  speed = 5; // The speed at which the banners is moved (1 - 10, anything above 5 is not recommended).
  wait = true;

  banner1 = document.getElementById("banner1");
  banner2 = document.getElementById("banner2");
  link1 = document.getElementById("link1");
  link2 = document.getElementById("link2");

  banner1 = document.getElementById("banner1");
  banner2 = document.getElementById("banner2");

  banner1.style.left = 0;
  banner2.style.left = 500;

  bannerIndex = 1;

  /* Important: In order for this script to work properly, please make sure that the banner graphic and the
  URL associated with it have the same index in both, the bannerLocations and bannerURLs arrays.
  Duplicate URLs are permitted. */

  // Enter the location of the banner graphics in the array below.
  bannerLocations = new Array("internet-lg.gif","jupiterweb.gif","jupitermedia.gif");

  // Enter the URL's to which the banners will link to in the array below.
  bannerURLs = new Array("http://www.internet.com","http://www.jupiterweb.com","http://www.jupitermedia.com");
}

function moveBanner(){
  if(!wait){
    banner1.style.left = parseInt(banner1.style.left) -  (speed * 5);
    banner2.style.left = parseInt(banner2.style.left) - (speed * 5);
    if(parseInt(banner1.style.left) <= -500){
      banner1.style.left = 500;
      bannerIndex = (bannerIndex < (bannerLocations.length - 1)) ? ++bannerIndex :0;
      banner1.src = bannerLocations[bannerIndex];
      link1.href = bannerURLs[bannerIndex];
      wait = true;
    }
    if(parseInt(banner2.style.left) <= -500){
      banner2.style.left = 500;
      bannerIndex = (bannerIndex < (bannerLocations.length - 1)) ? ++bannerIndex :0;
      banner2.src = bannerLocations[bannerIndex];
      link2.href = bannerURLs[bannerIndex];
      wait = true;
    }

    setTimeout("moveBanner()",100);
  } else {
      wait = false;
      setTimeout("moveBanner()", displayTime * 1000);
  }
}
-->
</script>
</HEAD>

<!-- STEP TWO: Insert the onLoad event handler into your BODY tag  -->

<BODY onLoad="initVar(); moveBanner()">

<!-- STEP THREE: Copy this code into the BODY of your HTML document  -->

<div align="center">
<div name="addbox" id="addbox">
<a name="link1" id="link1" href="http://www.internet.com"><img border="0" name="banner1" id="banner1" src="internet-lg.gif"></a>
<a name="link2" id="link2" href="http://www.jupiterweb.com"><img border="0" name="banner2" id="banner2" src="jupiterweb.gif"></a>
</div></div>
Kayıtlı
Sayfa: [1] Yazdır 
Etiketler: