Пятница, 17.05.2024, 15:19
Приветствую Вас Гость | RSS

Каталог статей

Главная » Статьи » Все для Web-Мастера » Для UcoZ [ Добавить статью ]

Меню которое нужно вытащить мышкой
пример можно посмотреть ТУТ
в HEAD ставим
<style>  
<!--  

#slidemenubar, #slidemenubar2{  
cursor:hand;  
position:absolute;  
left:-152px;  
width:160px;  
top:170px;  
border:1.5px solid green;  
background-color:lightyellow;  
layer-background-color:lightyellow;  
font:bold 12px Verdana;  
line-height:20px;  
}  
-->  
</style>[/code]
В само меню
[code]<script language="JavaScript1.2">  

/*  
Sliding Menu Bar Script 3- © Dynamic Drive (www.dynamicdrive.com)  
For full source code, installation instructions, and TOS  
Visit http://dynamicdrive.com  
*/  

var ns4=document.layers?1:0  
var ie4=document.all?1:0  
var ns6=document.getElementById&&!document.all?1:0  

if (ie4||ns6)  
document.write('<div id="slidemenubar2" style="left:-150">')  
else  
document.write('<layer id="slidemenubar">')  

var sitems=new Array()  
var sitemlinks=new Array()  

///////////Edit below/////////////////////////////////  

//extend or shorten this list  
sitems[0]="Ссылка"  
sitems[1]="Ссылка2"  
sitems[2]="Ссылка3"  

//These are the links pertaining to the above text.  
sitemlinks[0]="http://forucoz.com/"  
sitemlinks[1]="http://forucoz.com/"  
sitemlinks[2]="http://forucoz.com/"  

//If you want the links to load in another frame/window, specify name of target (ie: target="_new")  
var target=""  

/////////////////////////////////////////////////////////  

for (i=0;i<=sitems.length-1;i++)  
document.write('<a href='+sitemlinks[i]+' target="'+target+'">'+sitems[i]+'</a><br>')  

function regenerate(){  
window.location.reload()  
}  
function regenerate2(){  
if (ns4)  
setTimeout("window.onresize=regenerate",400)  
}  
window.onload=regenerate2  
if (ie4||ns6){  
document.write('</div>')  
themenu=(ns6)? document.getElementById("slidemenubar2").style : document.all.slidemenubar2.style  
rightboundary=0  
leftboundary=-150  
}  
else{  
document.write('</layer>')  
themenu=document.layers.slidemenubar  
rightboundary=150  
leftboundary=10  
}  
var dragapproved=false  
var x1,x2  
if (ns4)  
themenu.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)  

function move(e){  
if (ie4&&event.button==1&&dragapproved){  
if(temp1+event.clientX-x1>leftboundary)  
themenu.pixelLeft=Math.min(rightboundary,temp1+event.clientX-x1)  
else  
themenu.pix    elLeft=Math.max(leftboundary,temp1+event.clientX-x1)  
}  
else if (ns6&&dragapproved){  
if(parseInt(themenu.left)+e.clientX-x2>leftboundary)  
themenu.left=Math.min(rightboundary+2,temp1+e.clientX-x2)  
else  
theme    nu.left=Math.max(leftboundary-2,temp1+e.clientX-x2)  
}  

else if (ns4){  
if(themenu.left+e.x-x2>leftboundary)  
themenu.left=Math.min(rightboundary+2,themenu.left+e.x-x2)  
else  
themenu.left=Math.max(leftbo    undary-2,themenu.left+e.x-x2)  
}  
}  

function drags(e){  
if (ie4){  
dragapproved=true  
temp1=themenu.pixelLeft  
x1=event.clientX  
document.onmousemove=move  
}  
else if (ns6){  
dragapproved=true  
temp1=parseInt(themenu.left)  
x2=e.clientX  
document.getElementById("slidemenubar2").onmousemove=move  
}  
else{  
t    hemenu.captureEvents(Event.MOUSEMOVE)  
x2=e.x  
}  
}  

function stopit(){  
if (ie4||ns6){  
dragapproved=false  
}  
if (ns4)  
themenu.releaseEvents(Event.MOUSEMOVE)  
}  

if (ie4){  
document.all.slidemenubar2.onmousedown=drags  
document.all.slidemenubar2.onmouseup=new Function("dragapproved=false")  
document.onselectstart=new Function("return false")  
}  
else if (ns6){  
document.getElementById("slidemenubar2").onmousedown=drags  
document.getElementById("slidemenubar2").onmouseup=new Function("dragapproved=false")  
}  
else if (ns4){  
themenu.onmousedown=drags  
themenu.onmousemove=move  
themenu.onmouseup=stopit  
}  

</script>

Категория: Для UcoZ | Добавил: xaket (27.03.2009)
Просмотров: 651 | Комментарии: 1 | Рейтинг: 0.0/0
Всего комментариев: 0
Добавлять комментарии могут только зарегистрированные пользователи.
[ Регистрация | Вход ]

Категории раздела

Наш опрос

Оцените мой сайт
Всего ответов: 20

Статистика


Онлайн всего: 1
Гостей: 1
Пользователей: 0

Форма входа

Поиск