
11.04.2008, 22:21
|
|
Постоянный
Регистрация: 25.03.2008
Сообщений: 670
С нами:
9541766
Репутация:
2407
|
|
Вопрос не по теме, но набросал скрипт такой простенький для примера:
Код HTML:
<html><body onload="init()">
<script language='JavaScript'>
var imgmov=3; //на сколько сместить изображение
var shadowcolor='#c0c0c0'; //цвет тени
function init()
{
var st = document.getElementById('shad').style;
st.backgroundColor=shadowcolor;
}
function mov_img(mtype)
{
var st=document.getElementById('shad').style;
switch(mtype)
{
case 0:
st.marginLeft=-imgmov;
st.marginTop=-imgmov;
st.height=document.getElementById('img').height + imgmov;
st.width=document.getElementById('img').width + imgmov;
break;
case 1:
st.marginLeft=0;
st.marginTop=0;
st.height = document.getElementById('img').height;
st.width = document.getElementById('img').width;
break;
}
}
</script>
blabla<br>
<div style="width:0"><div id="shad"><img src='твоё_изображение' onmouseout="mov_img(1);" onmouseover="mov_img(0);" id="img" style="position:relative;"></div></div>
<br>blabla
</body></html>
Последний раз редактировалось d_x; 11.04.2008 в 22:42..
|
|
|