+ Ответить в теме
Показано с 1 по 10 из 10

Тема: собсно некоторые скрипты -)

Комбинированный просмотр

  1. #1
    Frost
    Guest

    Arrow собсно некоторые скрипты -)

    Простой календарик

    Код:
     
    <SCRIPT language=Javascript>
    calendar = new Date();
    day = calendar.getDay();
    document.write("<font face=arial><center><table width=100 border=1><td><center><font size=2>")
    if (day == 0) {
    document.write("Воскресенье")
    }
    if (day == 1) {
    document.write("Понедельник")
    }
    if (day == 2) {
    document.write("Вторник")
    }
    if (day == 3) {
    document.write("Среда")
    }
    if (day == 4) {
    document.write("Четверг")
    }
    if (day == 5) {
    document.write("Пятница")
    }
    if (day == 6) {
    document.write("Суббота")
    }
    if (day == 7) {
    document.write("Воскресенье")
    }
    document.write("</font></center></td><tr><td><center><font size=2>")
    month = calendar.getMonth();
    if (month == 0) {
    document.write("Январь")
    }
    if (month == 1) {
    document.write("Февраль")
    }
    if (month == 2) {
    document.write("Март")
    }
    if (month == 3) {
    document.write("Апрель")
    }
    if (month == 4) {
    document.write("Май")
    }
    if (month == 5) {
    document.write("Июнь")
    }
    if (month == 6) {
    document.write("Июль")
    }
    if (month == 7) {
    document.write("Август")
    }
    if (month == 8) {
    document.write("Сентябрь")
    }
    if (month == 9) {
    document.write("Октябрь")
    }
    if (month == 10) {
    document.write("Ноябрь")
    }
    if (month == 11) {
    document.write("Декабрь")
    }
    document.write("</font></center></td><tr><td><center><font size=7>")
    date = calendar.getDate();
    document.write(date)
    document.write("</font></center></td><tr><td><center><font size=2>")
    year = calendar.getYear();
    if (year < 100) {
    document.write("19" + year + "")
    }
    else if (year > 1999) {
    document.write(year)
    }
    document.write("</font></center></td></table>")
    </SCRIPT>

  2. #2
    Frost
    Guest

    По умолчанию часы в строке статуса

    Код:
    <Script Language="JavaScript">
    var timerID = null;
    var timerRunning = false;
    function stopclock ()
    {if(timerRunning)
    clearTimeout(timerID);
    timerRunning = false;}
    function showtime () 
    {var now = new Date();
    var hours = now.getHours();
    var minutes = now.getMinutes();
    var seconds = now.getSeconds();
    var timeValue = "" + hours;
    timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
    timeValue += ((seconds < 10) ? ":0" : ":") + seconds;
    window.status = timeValue;
    timerID = setTimeout("showtime()",1000);
    timerRunning = true;}
    function startclock () 
    {stopclock();
    showtime();}
    </Script>

  3. #3
    Frost
    Guest

    По умолчанию меняется цвет фона

    Код:
    <SCRIPT language=JavaScript>
    <!-- Start of JavaScript code 
    function setbackground()
    {
    window.setTimeout( "setbackground()", 1000); // 1000 milliseconds delay
    var index = Math.round(Math.random() * 9);
    var ColorValue = "FFFFFF"; // default color - white (index = 0)
    if(index == 1)
    ColorValue = "FFFFFF"; 
    if(index == 2)
    ColorValue = "800000"; 
    if(index == 3)
    ColorValue = "C0C0C0"; 
    if(index == 4)
    ColorValue = "00ff00"; 
    if(index == 5)
    ColorValue = "666666"; 
    if(index == 6)
    ColorValue = "333333"; 
    if(index == 7)
    ColorValue = "80ffff";
    if(index == 8)
    ColorValue = "FFCC99"; 
    if(index == 9)
    ColorValue = "CCCCCC"; 
    document.bgColor=ColorValue;
    }
    // -- End of JavaScript code -------------- -->
    </SCRIPT>

  4. #4
    Frost
    Guest

    По умолчанию падающие снежинки

    Код:
     
    <SCRIPT LANGUAGE="JavaScript1.2">
    <!-- Begin
    var no = 35; // количество снежинок
    var speed = 6; // скорость снежинок
    var snowflake = "sneg.gif"/*tpa=http://drgenius.h1.ru/sneg.gif*/;
    var ns4up = (document.layers) ? 1 : 0;
    var ie4up = (document.all) ? 1 : 0;
    var dx, xp, yp; 
    var am, stx, sty; 
    var i, doc_width = 800, doc_height = 600;
    if (ns4up) {
    doc_width = self.innerWidth;
    doc_height = self.innerHeight;
    } else if (ie4up) {
    doc_width = document.body.clientWidth;
    doc_height = document.body.clientHeight;
    }
    dx = new Array();
    xp = new Array();
    yp = new Array();
    am = new Array();
    stx = new Array();
    sty = new Array();
    for (i = 0; i < no; ++ i) {  
    dx[i] = 0;         
    xp[i] = Math.random()*(doc_width-50); 
    yp[i] = Math.random()*doc_height;
    am[i] = Math.random()*20;         
    stx[i] = 0.02 + Math.random()/10; 
    sty[i] = 0.7 + Math.random();   
    if (ns4up) {                  
    if (i == 0) {
    document.write("<layer name=\"dot"+ i +"\" left=\"15\" ");
    document.write("top=\"15\" visibility=\"show\"><img src=\"");
    document.write(snowflake + "\" border=\"0\"></layer>");
    } else {
    document.write("<layer name=\"dot"+ i +"\" left=\"15\" ");
    document.write("top=\"15\" visibility=\"show\"><img src=\"");
    document.write(snowflake + "\" border=\"0\"></layer>");
       }
    } else if (ie4up) {
    if (i == 0) {
    document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
    document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
    document.write("visible; TOP: 15px; LEFT: 15px;\"><img src=\"");
    document.write(snowflake + "\" border=\"0\"></div>");
    } else {
    document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
    document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
    document.write("visible; TOP: 15px; LEFT: 15px;\"><img src=\"");
    document.write(snowflake + "\" border=\"0\"></div>");
          }
       }
    }
    function snowNS() { 
    for (i = 0; i < no; ++ i) {  
    yp[i] += sty[i];
    if (yp[i] > doc_height-50) {
    xp[i] = Math.random()*(doc_width-am[i]-30);
    yp[i] = 0;
    stx[i] = 0.02 + Math.random()/10;
    sty[i] = 0.7 + Math.random();
    doc_width = self.innerWidth;
    doc_height = self.innerHeight;
    }
    dx[i] += stx[i];
    document.layers["dot"+i].top = yp[i];
    document.layers["dot"+i].left = xp[i] + am[i]*Math.sin(dx[i]);
    }
    setTimeout("snowNS()", speed);
    }
    function snowIE() { 
    for (i = 0; i < no; ++ i) { 
    yp[i] += sty[i];
    if (yp[i] > doc_height-50) {
    xp[i] = Math.random()*(doc_width-am[i]-30);
    yp[i] = 0;
    stx[i] = 0.02 + Math.random()/10;
    sty[i] = 0.7 + Math.random();
    doc_width = document.body.clientWidth;
    doc_height = document.body.clientHeight;
    }
    dx[i] += stx[i];
    document.all["dot"+i].style.pixelTop = yp[i];
    document.all["dot"+i].style.pixelLeft = xp[i] + am[i]*Math.sin(dx[i]);
    }
    setTimeout("snowIE()", speed);
    }
    if (ns4up) {
    snowNS();
    } else if (ie4up) {
    snowIE();
    }
    // End -->
    </script>

  5. #5
    Frost
    Guest

    По умолчанию блокирует правую кнопку мыши

    Код:
     
    <script language="JavaScript1.2">
    if (document.all) document.body.onmousedown=new Function("if (event.button==2||event.button==3)alert('Ваш текст ')")
    </script>
    пока хватит а то за флуд посчитают ;)

  6. #6
    Джедай nons Трогаюсь nons Трогаюсь nons Трогаюсь nons Трогаюсь nons Трогаюсь nons Трогаюсь nons Трогаюсь nons Трогаюсь nons Трогаюсь nons Трогаюсь nons Трогаюсь
    Регистрация
    22.01.2005
    Сообщений
    3,753
    Поблагодарил(а)
    419
    Получено благодарностей: 1,257 (сообщений: 528).

    По умолчанию

    Цитата Сообщение от Frost
    ...
    пока хватит а то за флуд посчитают ;)

    Оффтопик
    Телевизор — это просто маленькое прозрачное окошко в трубе духовного мусоропровода. © В. Пелевин.

  7. #7
    N!cht
    Guest

    Red face мэни сорри, просто моя не понимать

    Цитата Сообщение от Frost
    Код:
     
    <script language="JavaScript1.2">
    if (document.all) document.body.onmousedown=new Function("if (event.button==2||event.button==3)alert('Ваш текст ')")
    </script>

    Оффтопик

+ Ответить в теме

Информация о теме

Пользователи, просматривающие эту тему

Эту тему просматривают: 1 (пользователей: 0 , гостей: 1)

     

Похожие темы

  1. Скрипты!
    от Isspanec в разделе CS
    Ответов: 4
    Последнее сообщение: 17.04.2006, 12:02

Ваши права

  • Вы не можете создавать новые темы
  • Вы не можете отвечать в темах
  • Вы не можете прикреплять вложения
  • Вы не можете редактировать свои сообщения
Рейтинг@Mail.ru
Администрация сайта не выражает согласия
с высказыванием участников форума и не несет
ответственности за их содержание.

Копирование любого материала возможно только
при наличии ссылки на сайт.