![]() | |
| ||||
| selam arkadaşlar bana öyle bir kod lazım ki hem sayfa yenilemesinde background resmini random olarak değiştirsin, hemde ekran çözünürlüğü(pencere boyutu) ne boyda olursa olsun sorun yaratmadan pencereye oturtabilsin. yardımcı olursanız çok sevinirim.
__________________ deli dana = Radyoaktif dalga motoru |
| ||||
| Daha önce aşağıdaki scripti kullanmıştım rastgele resim galerisi yaparken. İstersen bir dene. [HTML] <HEAD> <SCRIPT LANGUAGE="JavaScript"> <!-- This script and many more are available free online at --> <!-- The JavaScript Source!! http://javascript.internet.com --> <!-- Begin // Set up the image files to be used. var theImages = new Array() // do not change this // To add more image files, continue with the // pattern below, adding to the array. theImages[0] = '1.gif' theImages[1] = '2.gif' theImages[2] = '3.gif' theImages[3] = '4.gif' // do not edit anything below this line var j = 0 var p = theImages.length; var preBuffer = new Array() for (i = 0; i < p; i++){ preBuffer[i] = new Image() preBuffer[i].src = theImages[i] } var whichImage = Math.round(Math.random()*(p-1)); function showImage(){ document.write('<img src="'+theImages[whichImage]+'">'); } // End --> </script> </HEAD> <!-- STEP TWO: Copy this code into the BODY of your HTML document --> <BODY> <SCRIPT LANGUAGE="JavaScript"> <!-- This script and many more are available free online at --> <!-- The JavaScript Source!! http://javascript.internet.com --> <!-- Begin showImage(); // End --> </script> <p><center> <font face="arial, helvetica" size"-2">Free JavaScripts provided<br> by <a href="http://javascriptsource.com">The JavaScript Source</a></font> </center><p> [/HTML] Yabancı bir siteden aldım, hızlı cevap vereyim diye düzenlemedim. Sanırım açık ve net? =)
__________________ Tilki'nin günlüğü |
| ||||
| bu kod sayfa üzerindeki imajı rastgele değiştirebiliyor malesef. bana background resmini değiştirebilecek bişey lazım
__________________ deli dana = Radyoaktif dalga motoru |
| ||||
| [html]document.write('<img src="'+theImages[whichImage]+'">');[/html]kısmını : [html]document.write('+theImages[whichImage]+');[/html]olarak değiştirip [html]<SCRIPT LANGUAGE="JavaScript"> <!-- This script and many more are available free online at --> <!-- The JavaScript Source!! http://javascript.internet.com --> <!-- Begin showImage(); // End --> </script> [/html]kısmını da background a göre değiştirsek olmuyor mu acaba? [html]<body background='showImage();'>[/html]Denemedim. sadece yazdım. istersen dene. Tabii javascript ten pek anlamadığımı sadece programcı mantığım olduğunu söyleyebilirim sana :S Bunuda DynamicDrive da buldum: Changing background image script [Archive] - Dynamic Drive Forums
__________________ Tilki'nin günlüğü |
![]() |
| Konuyu Toplam 1 Üye okuyor. (0 Kayıtlı üye ve 1 Misafir) | |
| Seçenekler | |
| Stil | |
| |
Benzer Konular | ||||
| Konu | Konuyu Başlatan | Forum | Cevaplar | Son Mesaj |
| Mükemmel Background lar | sesar | Web / Grafik Tasarım | 23 | 05-02-2008 12:46:58 |
| Bir İlk Daha...Bir Sürü Arkaplan ( Background ) [ Web Sitesi İçin ] | srknakn | Web / Grafik Tasarım | 1 | 17-10-2007 22:40:02 |
| Xml den image çagırma sorunu? | sururi | Flash, Director, Swift ve 3D | 3 | 29-08-2007 20:19:20 |
| Zenphoto Image Gallery v1.0.4 | webatesi | Script / Veritabanı ( Database ) | 1 | 31-05-2007 23:48:15 |
| Advanced Image Host Script / Yabsoft | PrompHeuS | Script / Veritabanı ( Database ) | 8 | 18-05-2007 13:24:51 |