Пятница, 29.03.2024, 02:28
ГлавнаяРегистрацияВход
Приветствую Вас Гость | RSS
[ Новые сообщения · Участники · Правила форума · Поиск · RSS ]
  • Страница 1 из 1
  • 1
Форум » Web-Мастеру » HTML и CSS » Меню карусель
Меню карусель
all-softДата: Четверг, 22.05.2008, 22:41 | Сообщение # 1
Admin
Группа: Администраторы
Сообщений: 10048
Репутация: 1
Статус: Offline
Содержимое этой таблицы поместите между <HEAD> и </HEAD>
Code
<!-- from www.pokolenie.ucoz.ru -->

<style>
a:link, a:visited, a:active { text-decoration: none; color: navy;}
a:hover { text-decoration: none; color: yellow; }
</style>
<STYLE>.fly {
COLOR: aqua; FONT-FAMILY: arial; FONT-SIZE: 20px; POSITION: absolute; VISIBILITY: hidden; Z-INDEX: 2
}
.logo {FILTER: shadow(color:996633,direction=225,enabled:1); <!---СОЗДАЕТ ОБЪЕМ ЗАГЛАВИЯ-->
COLOR: lightgreen; FONT-FAMILY: times; FONT-SIZE: 35px; LEFT: 30px; POSITION: absolute; TOP: 0px; VISIBILITY: visible; Z-INDEX: 1
}
.desc {
COLOR: red; FONT-FAMILY: arial; FONT-SIZE: 12px; LEFT: 20px; POSITION: absolute; TEXT-ALIGN: center; TOP: 320px; VISIBILITY: hidden; WIDTH: 400px
}
</STYLE><SCRIPT language=JavaScript>

/* Show an object */
function showObject(object) {
object.visibility = VISIBLE;
}

/* Hide an object */
function hideObject(object) {
object.visibility = HIDDEN;
}

/* Slide the logo from top to middle */
function slideLogo(from, to) {
if (from < to) {
company.top = (from += 10);
setTimeout('slideLogo(' + from + ',' + to + ')', 75);
}
else initObjects();
}

/* Rotate selected objects */
function rotateObjects() {
for (var i = 0; i < pos.length; i++) {
pos[i] += inc; objects[i].visibility = 'visible';
objects[i].left = (r * Math.cos(pos[i])) + xoff
objects[i].top = (r * Math.sin(pos[i])) + yoff;
}
rotateTimer = setTimeout("rotateObjects()", 70);
}

/* Initialize selected objects for rotation */
function initObjects() {
/* Here is the array of HTML elements that will be rotated, from fly1 to fly4   
Just put the shortcut variables to the HTML elements in this little array
and they will be rotated automatically */
objects = new Array(fly1, fly2, fly3, fly4);
pos = new Array();
pos[0] = 0;
for (var i = 1; i < objects.length; i++) {
pos[i] = parseFloat(pos[i - 1] + ((2 * pi) / objects.length));
}
rotateObjects();
}

/* Variables for rotating objects */
var objects;
var pos;
var r = 100; // РАДИУС
var xoff = 130; // РАССТОЯНИЕ ОТ ЦЕНТРА ОКРУЖНОСТИ ДО ЛЕВОГО КРАЯ
var yoff = 170; // РАССТОЯНИЕ ОТ ЦЕНТРА ОКРУЖНОСТИ ДО ВЕРХНЕГО КРАЯ
var pi = Math.PI;
var inc = pi / 180; // degrees per rotation cycle
var objects; // objects to be rotated
var pos; // position for objects

</SCRIPT>

Содержимое этой таблицы поместите между <BODY> и </BODY>
Code
<DIV class=fly id=fly1>
<P><A   
href="#top"   
onmouseout=hideObject(desc1) onmouseover=showObject(desc1)>Важная ссылка !</A> </P></DIV>
<DIV class=fly id=fly2 style="z-index:-2">
<P><A   
href="#top"   
onmouseout=hideObject(desc2) onmouseover=showObject(desc2) >Java Scripts</A> </P></DIV>
<DIV class=fly id=fly3 style="z-index:-2">
<P><A   
href="#top"   
onmouseout=hideObject(desc3) onmouseover=showObject(desc3)   
><img src="spinstar.gif" border=0></A> </P></DIV>
<DIV class=fly id=fly4>
<P><A   
href="#top"   
onmouseout=hideObject(desc4) onmouseover=showObject(desc4)   
>Главная</A> </P></DIV>
<!----КОММЕНТАРИИ (ПОДСКАЗКИ) К ССЫЛКАМ---->
<DIV class=logo id=company>
<P>Карусельное меню</P></DIV>
<DIV class=desc id=desc1>
<P>Комментарий к важной ссылке</P></DIV>
<DIV class=desc id=desc2>
<P>Оглавление раздела</P></DIV>
<DIV class=desc id=desc3>
<P>Наши награды</P></DIV>
<DIV class=desc id=desc4>
<P>Главная страница сайта</P></DIV>
<SCRIPT language=JavaScript>

/* Simple version detection */
var isNS = (navigator.appName == "Netscape" && parseInt(navigator.appVersion) >= 4);

/* They can be used in place
of hidden and visible because on occasion Navigator has problems with the two */
var HIDDEN = (isNS) ? 'hide' : 'hidden';
var VISIBLE = (isNS) ? 'show' : 'visible';

/* Create shortcut variables for different absolutely positioned elements */
var fly1 = (isNS) ? document.fly1 : document.all.fly1.style;
var fly2 = (isNS) ? document.fly2 : document.all.fly2.style;
var fly3 = (isNS) ? document.fly3 : document.all.fly3.style;
var fly4 = (isNS) ? document.fly4 : document.all.fly4.style;
var company = (isNS) ? document.company : document.all.company.style;
var desc1 = (isNS) ? document.desc1 : document.all.desc1.style;
var desc2 = (isNS) ? document.desc2 : document.all.desc2.style;
var desc3 = (isNS) ? document.desc3 : document.all.desc3.style;
var desc4 = (isNS) ? document.desc4 : document.all.desc4.style;

/* Begin the sliding of the logo */
slideLogo(0, 140);

</SCRIPT>
 
Награды:
Форум » Web-Мастеру » HTML и CSS » Меню карусель
  • Страница 1 из 1
  • 1
Поиск:

Copyright MyCorp © 2024Сделать бесплатный сайт с uCoz