UzmanWeb.Net Forum

--- JAVASCRIPT ARŞİVİ --- (Okunma sayısı 67023 defa)

0 Üye ve 1 Ziyaretçi konuyu incelemekte.

AdmiN

* Ocak 22, 2007, 18:09:26 ÖS
Durum Çubuğunda Yazı (Aşağıdaki kodları body tagları arasına ekleyin.

Kod: [Seç]

<SCRIPT LANGUAGE="JavaScript">
<!--// Copyright 1996 - Tomer and Yehuda Shiran
// This example will appear in our forthcoming book on JavaScript.
// Feel free to "steal" this code provided that you leave this notice as is.
// Additional examples from the book can be found at http://www.geocities.com/SiliconValley/9000/
// For more information contact Tomer or Yehuda Shiran <yshiran@iil.intel.com>

// set speed of banner (pause in milliseconds between addition of new character)
var speed = 10

// decrease value to increase speed (must be positive)
// set pause between completion of message and beginning of following message
var pause = 1500

// increase value to increase pause
// set initial values
var timerID = null
var bannerRunning = false

// create array
var ar = new Array()

// assign the strings to the array's elements
ar[0] = ".. :: www.uzmanweb.net :: .."

// assign index of current message
var message = 0

// empty string initialization
var state = ""

// no value is currently being displayed
clearState()

// stop the banner if it is currently running
function stopBanner() {
// if banner is currently running
if (bannerRunning)
// stop the banner
clearTimeout(timerID)
// timer is now stopped
timerRunning = false
}

// start the banner
function startBanner() {
// make sure the banner is stopped
stopBanner()
// start the banner from the current position
showBanner()
}

// assign state a string of "0" characters of the length of the current message
function clearState() {
// initialize to empty string
state = ""
// create string of same length containing 0 digits
for (var i = 0; i < ar[message].length; ++i) {
state += "0"
}
}

// display the current message
function showBanner() {
// if the current message is done
if (getString()) {
// increment message
message++
// if new message is out of range wrap around to first message
if (ar.length <= message)
message = 0
// new message is first displayed as empty string
clearState()
// display next character after pause milliseconds
timerID = setTimeout("showBanner()", pause)
}
else {
// initialize to empty string
var str = ""
// built string to be displayed (only character selected thus far are displayed)
for (var j = 0; j < state.length; ++j) {
str += (state.charAt(j) == "1") ? ar[message].charAt(j) : "     "
}
// partial string is placed in status bar
window.status = str
// add another character after speed milliseconds
timerID = setTimeout("showBanner()", speed)
}
}

function getString() {
// set variable to true (it will stay true unless proven otherwise)
var full = true
// set variable to false if a free space is found in string (a not-displayed char)
for (var j = 0; j < state.length; ++j) {
// if character at index j of current message has not been placed in displayed string
if (state.charAt(j) == 0)
full = false
}
// return true immediately if no space found (avoid infinitive loop later)
if (full) return true
// search for random until free space found (braoken up via break statement)
while (1) {
// a random number (between 0 and state.length - 1 == message.length - 1)
var num = getRandom(ar[message].length)
// if free space found break infinitive loop
if (state.charAt(num) == "0")
break
}
// replace the 0 character with 1 character at place found
state = state.substring(0, num) + "1" + state.substring(num + 1, state.length)
// return false because the string was not full (free space was found)
return false
}

function getRandom(max) {
// create instance of current date
var now = new Date()
// create a random number (good generator)
var num = now.getTime() * now.getSeconds() * Math.random()
// cut random number to value between 0 and max - 1, inclusive
return num % max
}
startBanner()
// -->
</SCRIPT>
Kayıtlı

ALpeR

#1 * Ocak 22, 2007, 18:15:06 ÖS
body tagları derken ? hangi dosyanın içerisinde acaba bu ?
Kayıtlı
Pioneer DreamBook® Power D90
Intel® Core™2 Extreme X6800 2.93G 4M Cache 1066M FSB Processor + 4GB (2 x 2GB) 800MHz DDR2 RAM + 2x512MB Dual NVidia SLI GeForce Go 8700M GT + 17\\\\\\\" Widescreen WUXGA+ (1920x1200) TFT Screen + 3 x 200GB 7,200RPM Serial-ATA Hard Drive

AdmiN

#2 * Ocak 22, 2007, 22:10:58 ÖS
Burdaki javascitler html sayfa hazırlarken body kodları arasına ekleniyor.Hazır sitelerde de sitenin ana dosyasına ekleniyor.
index.php ve default.asp  ya da sitenin içinde tüm sayfalara eklenmiş başka bir sayfa da olabilir.
Kayıtlı

AdmiN

#3 * Şubat 15, 2007, 23:20:12 ÖS
kayan yazı alt sol:

Kod: [Seç]
<SCRIPT LANGUAGE="JavaScript">
<!--// Copyright 1996 - Tomer and Yehuda Shiran
// This example will appear in our forthcoming book on JavaScript.
// Feel free to "steal" this code provided that you leave this notice as is.
// Additional examples from the book can be found at http://www.geocities.com/SiliconValley/9000/
// For more information contact Tomer or Yehuda Shiran <yshiran@iil.intel.com>

// set speed of banner (pause in milliseconds between addition of new character)
var speed = 10

// decrease value to increase speed (must be positive)
// set pause between completion of message and beginning of following message
var pause = 1500

// increase value to increase pause
// set initial values
var timerID = null
var bannerRunning = false

// create array
var ar = new Array()

// assign the strings to the array's elements
ar[0] = "Sitemize Hosgeldiniz"
ar[1] = "Umarim sitemizden Hoslanirsiniz"
ar[2] = "UzmanWeb"
ar[3] = "www.uzmanweb.net"

// assign index of current message
var message = 0

// empty string initialization
var state = ""

// no value is currently being displayed
clearState()

// stop the banner if it is currently running
function stopBanner() {
// if banner is currently running
if (bannerRunning)
// stop the banner
clearTimeout(timerID)
// timer is now stopped
timerRunning = false
}

// start the banner
function startBanner() {
// make sure the banner is stopped
stopBanner()
// start the banner from the current position
showBanner()
}

// assign state a string of "0" characters of the length of the current message
function clearState() {
// initialize to empty string
state = ""
// create string of same length containing 0 digits
for (var i = 0; i < ar[message].length; ++i) {
state += "0"
}
}

// display the current message
function showBanner() {
// if the current message is done
if (getString()) {
// increment message
message++
// if new message is out of range wrap around to first message
if (ar.length <= message)
message = 0
// new message is first displayed as empty string
clearState()
// display next character after pause milliseconds
timerID = setTimeout("showBanner()", pause)
}
else {
// initialize to empty string
var str = ""
// built string to be displayed (only character selected thus far are displayed)
for (var j = 0; j < state.length; ++j) {
str += (state.charAt(j) == "1") ? ar[message].charAt(j) : " "
}
// partial string is placed in status bar
window.status = str
// add another character after speed milliseconds
timerID = setTimeout("showBanner()", speed)
}
}

function getString() {
// set variable to true (it will stay true unless proven otherwise)
var full = true
// set variable to false if a free space is found in string (a not-displayed char)
for (var j = 0; j < state.length; ++j) {
// if character at index j of current message has not been placed in displayed string
if (state.charAt(j) == 0)
full = false
}
// return true immediately if no space found (avoid infinitive loop later)
if (full) return true
// search for random until free space found (braoken up via break statement)
while (1) {
// a random number (between 0 and state.length - 1 == message.length - 1)
var num = getRandom(ar[message].length)
// if free space found break infinitive loop
if (state.charAt(num) == "0")
break
}
// replace the 0 character with 1 character at place found
state = state.substring(0, num) + "1" + state.substring(num + 1, state.length)
// return false because the string was not full (free space was found)
return false
}

function getRandom(max) {
// create instance of current date
var now = new Date()
// create a random number (good generator)
var num = now.getTime() * now.getSeconds() * Math.random()
// cut random number to value between 0 and max - 1, inclusive
return num % max
}
startBanner()
// -->
</SCRIPT>
Kayıtlı

AdmiN

#4 * Şubat 15, 2007, 23:22:54 ÖS
sayfa yüklemesi % olarak

Kod: [Seç]
<SCRIPT language=VBScript>
   <!--
   Dim Bar, Line, SP
   Bar = 0
   Line = "|"
   sP = 100

   Function Window_onLoad()
     Bar = 95
     sP = 10
   END Function

   Function Count()
   If Bar < 100 Then
      Bar = Bar + 1
      Window.Status = "Sayfa Yükleme Durumu: " & Bar & "%" & " " & String(Bar, Line)
      setTimeout "Count()", SP
   Else
      Window.Status = "Sayfa Yükleme Durumu: Yüklendi"
      Document.Body.Style.Display = ""
   End If
   End Function

   Call Count()
   -->
   </SCRIPT>
Kayıtlı

AdmiN

#5 * Şubat 15, 2007, 23:24:29 ÖS
Sitenizi başlangıç safası yapma

Kod: [Seç]
<A href="http://www.uzmanweb.net/"
onClick="this.style.behavior='url(#default#homepage)';
this.setHomePage('http://www.uzmanweb.net');"><FONT
color=#000066 size=2>Giriş Sayfası Yap</A>
Kayıtlı

AdmiN

#6 * Şubat 15, 2007, 23:26:29 ÖS
Sitenizi Sık kullanılanlar listesine ekletin. (Site adı ve adresini değiştirebilirsiniz.)

Kod: [Seç]
<SCRIPT language=JavaScript>
if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {

var url="http://www.uzmanweb.net";
var title="UzmanWeb.Net";
var bookmarkicon="favicon.ico"
document.write('<A HREF="javascript:window.ext');
document.write('ernal.AddFavorite(url,title);" ');
document.write('onMouseOver=" window.status=');
document.write("'Sitenizi favorilere ekleyin!'; return true ");
document.write('"onMouseOut=" window.status=');
document.write("' '; return true ");
document.write('"><font color="#000066" size="2">Sık Kullanılanlara ekleyin.</a>');
}
else {
var msg = "Don't forget to bookmark us!";
if(navigator.appName == "Netscape") msg += "  (CTRL-D)";
document.write(msg);
}

// End -->
</SCRIPT>
Kayıtlı

AdmiN

#7 * Şubat 15, 2007, 23:28:34 ÖS
Uyarılı Sağ Tuş Kilidi

Kod: [Seç]
<script language="JavaScript1.1">
<!-- Original: Martin Webb (martin@irt.org) -->
<!-- Begin
function right(e) {
if (navigator.appName == 'Netscape' &&
(e.which == 3 || e.which == 2))
return false;
else if (navigator.appName == 'Microsoft Internet Explorer' &&
(event.button == 2 || event.button == 3)) {
alert("Kaynagi göremezsin! Yasak! ...");
return false;
}
return true;
}

document.onmousedown=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
window.onmousedown=right;
// End -->
</script><script
language"javascript1.1">
<!-- Begin
// to prevent right click on images include:
for (var i=0; i<document.images.length; i++)
document.images.onmousedown=right;

// to prevent right click on links include:
for (var i=0; i<document.links.length; i++)
document.links.onmousedown=right;
// End -->
</script>
Kayıtlı

JrNeutron

#8 * Şubat 16, 2007, 21:15:11 ÖS
başlangıç yazısı
Kod: [Seç]
<SCRIPT LANGUAGE="JavaScript">
<!--
function GetCookie(name) {
var arg=name+"=";
var alen=arg.length;
var clen=document.cookie.length;
var i=0;
while (i<clen) {
var j=i+alen;
if
(document.cookie.substring(i,j)==arg)
return "here";
i=document.cookie.indexOf(" ",i)+1;
if (i==0) break;
}
return null;
}
var visit=GetCookie("shant");
if (visit==null){
alert("Hosgeldiniz...");
var expire=new Date();
expire=new
Date(expire.getTime()+7776000000);
document.cookie="shant=here; expires="+expire;
}
// -->
</SCRIPT>
 
Son Düzenleme: Şubat 16, 2007, 21:24:07 ÖS Gönderen: n_e_o
Kayıtlı

JrNeutron

#9 * Şubat 16, 2007, 21:16:50 ÖS
yazıcıya gönder


Kod: [Seç]
<!--- KAYNAK: http://www.gezginler.net --->
<SCRIPT LANGUAGE="JavaScript">
var da = (document.all) ? 1 : 0;
var pr = (window.print) ? 1 : 0;
var mac = (navigator.userAgent.indexOf("Mac") != -1);

function printPage() {
  if (pr) // NS4, IE5
    window.print()
  else if (da && !mac) // IE4 (Windows)
    vbPrintPage()
  else // other browsers
    alert("Sorry, your browser doesn't support this feature.");
  return false;
}

if (da && !pr && !mac) with (document) {
  writeln('<OBJECT ID="WB" WIDTH="0" HEIGHT="0" CLASSID="clsid:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>');
  writeln('<' + 'SCRIPT LANGUAGE="VBScript">');
  writeln('Sub window_onunload');
  writeln('  On Error Resume Next');
  writeln('  Set WB = nothing');
  writeln('End Sub');
  writeln('Sub vbPrintPage');
  writeln('  OLECMDID_PRINT = 6');
  writeln('  OLECMDEXECOPT_DONTPROMPTUSER = 2');
  writeln('  OLECMDEXECOPT_PROMPTUSER = 1');
  writeln('  On Error Resume Next');
  writeln('  WB.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER');
  writeln('End Sub');
  writeln('<' + '/SCRIPT>');
}
</SCRIPT>
<A HREF="#" onClick="return printPage()">Sayfayı yazdır...</A>
<!--- KAYNAK: http://www.gezginler.net --->
Son Düzenleme: Şubat 16, 2007, 21:21:01 ÖS Gönderen: n_e_o
Kayıtlı