Google-Translate Войти на сайт
 
МЕНЮ САЙТА
РАЗДЕЛЫ
Уроки Ucoz [13]
Уроки Borda.ru [13]
Уроки Photoshop [32]
Уроки Adobe Illustrator [1]
Уроки HTML и CSS [13]
JAVA-Скрипты [15]
Веб-дизайн [17]
Создание и продвижение сайта [92]
Интересные статьи [279]
ВЕЛОЛЮБИТЕЛЯМ!
Ярмарка Мастеров - ручная работа, handmade
КОНТАКТЫ
ICQ: 177700574
skype: k-dezign
mail: k-dezign@mail.ru
Мы Вконтакте
НАШИ ДРУЗЬЯ
Быстрая и недорогая раскрутка сайта
Регистрация в каталогах
Сибирский рубеж - автоэмали оптом и в розницу. Подбор автоэмалей PROFIX.
Хорошие новости о животных
WOlist.ru - каталог качественных сайтов Рунета
FONWEB.RU - Веб-дизайн
Интересные статьи
Клипарт на прозрачной основе


ЗАРЕГИСТРИРОВАТЬ СВОЙ САЙТ
СТАТИСТИКА
Онлайн всего: 1
Гостей: 1
Пользователей: 0
Главная | Полезные статьи
Главная » Статьи » JAVA-Скрипты

Скрипт: Фотоальбом на сайте
Пример.

Вставьте этот код после <body>: <style type="text/css">
#fsClipper { height: 330px; width: 100%; overflow: auto; //overflow: hidden; //overflow-x: auto; }
.fsControl, #fsLinks a { color: darkblue; cursor: pointer; //cursor: hand; }
.fsControl.disabled, #fsLinks a.current { color: #000000; cursor: default; text-decoration: none; }
.fsControl.disabled { color: #666666; }
#fsScreen { height: 300px ! important; background: no-repeat 50% 50%; }
</style>
<div id="fsClipper">
<div id="fsScreen"></div>
</div>
<p>
<span id="fsControl_prev" class="fsControl">←</span>
<span id="fsControl_next" class="fsControl">→</span>
</p>
<p id="fsLinks">
<a href="01.jpg" onclick="return Show_picture( '01.jpg')">1</a>
<a href="02.jpg" onclick="return Show_picture( '02.jpg')">2</a>
<a href="03.jpg" onclick="return Show_picture( '03.jpg')">3</a>
</p>
<script type="text/javascript">
function Filmstrip(){
this.ePicture = document.getElementById('fsScreen');
this.ePrev = document.getElementById('fsControl_prev');
this.eNext = document.getElementById('fsControl_next');
var eLinks = document.getElementById('fsLinks');
this.aeLink = eLinks.getElementsByTagName('A');
this.show_picture = function( sBackground, iWidth, iHeight ){
this.ePicture.style.backgroundImage = "url(" + sBackground + ")";
if( iWidth )
this.ePicture.style.width = iWidth;
if( iHeight )
this.ePicture.style.height = iHeight;
this.set_current( sBackground );
}
this.set_current = function( sHref ){
for( var i = 0 ; i < this.aeLink.length ; i++ ){
if( this.aeLink[i].href.match( new RegExp( sHref + "$" ) ) ){
this.aeLink[i].className += " current";
this.ePrev.className = this.ePrev.className.replace( /\s+disabled/g, "" );
this.eNext.className = this.eNext.className.replace( /\s+disabled/g, "" );
if( i == 0 ){
this.ePrev.className += " disabled";
this.ePrev.onclick = function(){};
this.eNext.onclick = this.aeLink[i + 1].onclick;
}else if( i == this.aeLink.length - 1 ){
this.eNext.className += " disabled";
this.eNext.onclick = function(){};
this.ePrev.onclick = this.aeLink[i - 1].onclick;
}else{
this.eNext.onclick = this.aeLink[i + 1].onclick;
this.ePrev.onclick = this.aeLink[i - 1].onclick;
}
}else{
this.aeLink[i].className = this.aeLink[i].className.replace( /\s*current/g, "" );
}
}
}
}
var oFilmstrip = new Filmstrip();
function Show_picture( sHref, iWidth, iHeight ){
oFilmstrip.show_picture( sHref, iWidth, iHeight );
return false;
}
oFilmstrip.aeLink[0].onclick();
</script>

где вместо 01.jpg, 02.jpg, 03.jpg подставьте адреса своих картинок (каждая 2 раза, обратите на это особое внимание)
Категория: JAVA-Скрипты | Добавил: Белая_Кошка (12.08.2011)
Просмотров: 6966 | Рейтинг: 0.0/0


Всего комментариев: 0
Добавлять комментарии могут только зарегистрированные пользователи.
[ Регистрация | Вход ]
Веб-студия "К-Дизайн" © 2009-2024
Контакты
ICQ: 177700574
skype: k-dezign
mail-агент: k-dezign@mail.ru

Счетчики
Яндекс цитирования
Работа
Создание сайтов и форумов
Порядок работы с заказами
Порядок оплаты заказов
Бонусы
Бесплатные кнопки для форумов
Бесплатные дизайны для форумов
Готовые шаблоны для сайтов
Уроки фотошоп
Уроки CMS Ucoz