Форум: Форум PHPФорум ApacheФорум Регулярные ВыраженияФорум MySQLHTML+CSS+JavaScriptФорум FlashРазное
Новые темы: 0000000
Самоучитель MySQL 5. Авторы: Кузнецов М.В., Симдянов И.В. PHP 5/6. В подлиннике. Авторы: Кузнецов М.В., Симдянов И.В. MySQL на примерах. Авторы: Кузнецов М.В., Симдянов И.В. PHP. Практика создания Web-сайтов (второе издание). Авторы: Кузнецов М.В., Симдянов И.В. C++. Мастер-класс в задачах и примерах. Авторы: Кузнецов М.В., Симдянов И.В.
ВСЕ НАШИ КНИГИ
Консультационный центр SoftTime

HTML+CSS+JavaScript

Выбрать другой форум

 

Здравствуйте, Посетитель!

вид форума:
Линейный форум Структурный форум

тема: JS цикл
 
 автор: freeing   (18.06.2008 в 17:17)   письмо автору
 
 

возможно ли циклом упростить ниже приведенный код:


    document.getElementById("div_0000").style.left            = left_0000;
    document.getElementById("div_0010").style.left            = left_0010;
    document.getElementById("div_0120").style.left            = left_0120;
    document.getElementById("div_0121").style.left            = left_0121;
    document.getElementById("div_0122").style.left            = left_0122;
    document.getElementById("div_0130").style.left            = left_0130;
    document.getElementById("div_0131").style.left            = left_0131;
    document.getElementById("div_0132").style.left            = left_0132;
    document.getElementById("div_0140").style.left            = left_0140;
    document.getElementById("div_0141").style.left            = left_0141;
    document.getElementById("div_0142").style.left            = left_0142;

    document.getElementById("div_0000").style.top             = top_0000;
    document.getElementById("div_0010").style.top             = top_0010;
    document.getElementById("div_0120").style.top             = top_0120;
    document.getElementById("div_0121").style.top             = top_0121;
    document.getElementById("div_0122").style.top             = top_0122;
    document.getElementById("div_0130").style.top             = top_0130;
    document.getElementById("div_0131").style.top             = top_0131;
    document.getElementById("div_0132").style.top             = top_0132;
    document.getElementById("div_0140").style.top             = top_0140;
    document.getElementById("div_0141").style.top             = top_0141;
    document.getElementById("div_0142").style.top             = top_0142;

    document.getElementById("div_0000").style.width           = width_0000;
    document.getElementById("div_0010").style.width           = width_0010;
    document.getElementById("div_0120").style.width           = width_0120;
    document.getElementById("div_0121").style.width           = width_0121;
    document.getElementById("div_0122").style.width           = width_0122;
    document.getElementById("div_0130").style.width           = width_0130;
    document.getElementById("div_0131").style.width           = width_0131;
    document.getElementById("div_0132").style.width           = width_0132;
    document.getElementById("div_0140").style.width           = width_0140;
    document.getElementById("div_0141").style.width           = width_0141;
    document.getElementById("div_0142").style.width           = width_0142;

    document.getElementById("div_0000").style.height          = height_0000;
    document.getElementById("div_0010").style.height          = height_0010;
    document.getElementById("div_0120").style.height          = height_0120;
    document.getElementById("div_0121").style.height          = height_0121;
    document.getElementById("div_0122").style.height          = height_0122;
    document.getElementById("div_0130").style.height          = height_0130;
    document.getElementById("div_0131").style.height          = height_0131;
    document.getElementById("div_0132").style.height          = height_0132;
    document.getElementById("div_0140").style.height          = height_0140;
    document.getElementById("div_0141").style.height          = height_0141;
    document.getElementById("div_0142").style.height          = height_0142;

    document.getElementById("div_0000").style.zIndex          = 0;
    document.getElementById("div_0010").style.zIndex          = 1;
    document.getElementById("div_0120").style.zIndex          = 2;
    document.getElementById("div_0121").style.zIndex          = 3;
    document.getElementById("div_0122").style.zIndex          = 4;
    document.getElementById("div_0130").style.zIndex          = 5;
    document.getElementById("div_0131").style.zIndex          = 6;
    document.getElementById("div_0132").style.zIndex          = 7;
    document.getElementById("div_0140").style.zIndex          = 8;
    document.getElementById("div_0141").style.zIndex          = 9;
    document.getElementById("div_0142").style.zIndex          = 10;

    document.getElementById("div_0000").style.position        = "absolute";
    document.getElementById("div_0010").style.position        = "absolute";
    document.getElementById("div_0120").style.position        = "absolute";
    document.getElementById("div_0121").style.position        = "absolute";
    document.getElementById("div_0122").style.position        = "absolute";
    document.getElementById("div_0130").style.position        = "absolute";
    document.getElementById("div_0131").style.position        = "absolute";
    document.getElementById("div_0132").style.position        = "absolute";
    document.getElementById("div_0140").style.position        = "absolute";
    document.getElementById("div_0141").style.position        = "absolute";
    document.getElementById("div_0142").style.position        = "absolute";

   
 
 автор: PAT   (18.06.2008 в 17:23)   письмо автору
 
   для: freeing   (18.06.2008 в 17:17)
 

Вы спросили ОДИН раз, вам ответили - http://www.softtime.ru/forum/read.php?id_forum=4&id_theme=54529&page=2

Что ещё убогому надо?

Неужели самостоятельно не можете вывести ОБЩИЙ ПРИНЦИП преобразования вашего маразма в цикл?

   
Rambler's Top100
вверх

Rambler's Top100 Яндекс.Метрика Яндекс цитирования