Блок перетаскивается мышкой. Установка: Ставите куда хотите данный код:
Code
<script type="text/javascript">
var ns4=document.layers
var ie4=document.all
var ns6=document.getElementById&&!document.all
var dragswitch=0
var nsx
var nsy
var nstemp
function drag_dropns(name){
if (!ns4) return
temp=eval(name)
temp.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
temp.onmousedown=gons
temp.onmousemove=dragns
temp.onmouseup=stopns
}
function gons(e){
temp.captureEvents(Event.MOUSEMOVE)
nsx=e.x
nsy=e.y
}
function dragns(e){
if (dragswitch==1){
temp.moveBy(e.x-nsx,e.y-nsy)
return false
}
}
function stopns(){
temp.releaseEvents(Event.MOUSEMOVE)
}
function drag_drop(e){
if (ie4&&dragapproved){
crossobj.style.left=tempx+event.clientX-offsetx
crossobj.style.top=tempy+event.clientY-offsety
return false
}
else if (ns6&&dragapproved){
crossobj.style.left=tempx+e.clientX-offsetx+"px"
crossobj.style.top=tempy+e.clientY-offsety+"px"
return false
}
}
function initializedrag(e){
crossobj=ns6? document.getElementById("showimage") :
document.all.showimage
var firedobj=ns6? e.target : event.srcElement
var topelement=ns6? "html" : document.compatMode && document.compatMode!="BackCompat"?
"documentElement" : "body"
while (firedobj.tagName!=topelement.toUpperCase() && firedobj.id!="dragbar"){
firedobj=ns6? firedobj.parentNode : firedobj.parentElement
}
if (firedobj.id=="dragbar"){
offsetx=ie4? event.clientX : e.clientX
offsety=ie4? event.clientY : e.clientY
tempx=parseInt(crossobj.style.left)
tempy=parseInt(crossobj.style.top)
dragapproved=true
document.onmousemove=drag_dro p
}
}
document.onmouseup=new Function("dragapproved=false")
function hidebox(){
crossobj=ns6? document.getElementById("showimage") : document.all.showimage
if (ie4||ns6)
crossobj.style.visibility="hidden"
else if (ns4)
document.showimage.visibility="hide"
}
</script><div id="showimage" style="position: absolute; width: 114px; left: 352px; top: 98px;">
<table bgcolor="#505050" border="0" cellpadding="2" cellspacing="0" width="250">
<tbody><tr>
<td width="100%"><table style="left: 1px;" border="0" cellpadding="0" cellspacing="0" width="240" height="264">
<tbody><tr>
<td id="dragbar" style="cursor: pointer;" onmousedown="initializedrag(event)" width="100%">
<ilayer width="100%" onselectstart="return false">
<layer width="100%" onmouseover="dragswitch=1;if (ns4) drag_dropns(showimage)" onmouseout="dragswitch=0">
<font color="#ffffff" face="Verdana">
<strong>cinemka.ru - Gta4!</strong></font></layer></ilayer><br></td>
<td style=""><a href="#" onclick="hidebox();return false" style="color: yellow;">X</a></td>
</tr>
<tr>
<td style="padding: 4px;" colspan="2" bgcolor="#ffffff" width="100%">
<img style="left: 6px; width: 232px;" src="http://img.66.ru/image/60f66fe267145246e0d6c192d430b8da/47dd6289/0/12/28/122838_normal.jpg">
</td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>
</div>
http://img.66.ru/image....mal.jpg - заменяете на своё.
Code
<table bgcolor="#505050" border="0" cellpadding="2" cellspacing="0" width="250">
- заменяете на своё, #505050 цвет блока, остальное размеры.
cinemka.ru - Gta4! - заменяете на своё.