JavaScript
Главная
Вход
Регистрация

JavaScript — объектно-ориентированный

скриптовый язык программирования.

Меню сайта

Категории раздела
Разное [14]
Иконки [1]
Приветствие [7]
Кодировщики [6]
Фото эффекты [6]
Хитрые скрипты [10]
Фрейм JavaScript [2]
Формат файла .js [1]
Эффекты с окнами [4]
Звуковые эффекты [4]
Ссылки и эффекты [12]
Текстовые эффекты [28]
Кнопки с эффектами [12]
Визуальные эффекты [10]
Эффекты с курсорами [6]
Онлайн генератор ников и паролей [2]
Софт, программы, скачать [15]

Главная » Файлы » Фрейм JavaScript

Фрейм ссылки.
01.08.2010, 23:28
iframe 1
iframe 2
iframe 3
Код:
<script type="text/javascript">
<!--
moz=document.getElementById&&!document.all
id=null
lastid=null
function dragMe(e,ID){
id=ID
if (!moz&&event.srcElement.className.indexOf("drag")!=-1||moz&&e.target.className.indexOf("drag")!=-1){
curposx=(!moz ? event.clientX : e.clientX)
curposy=(!moz ? event.clientY : e.clientY)
objectx=document.getElementById(id).offsetLeft
objecty=document.getElementById(id).offsetTop
document.getElementById(id).style.zIndex=5
if(lastid!=null&&lastid!=id){
document.getElementById(lastid).style.zIndex=''
}
moving=true
document.onmousemove=moveTo
}}
function moveTo(e){
xx=(!moz ? event.clientX : e.clientX)
yy=(!moz ? event.clientY : e.clientY)
if (moving==true){
document.getElementById(id).style.left=xx-(curposx-objectx)
document.getElementById(id).style.top=yy-(curposy-objecty)
return false
}}
document.onmouseup=new Function("moving=false;lastid=id")
offsetX=200
offsetY=30
last_id=""
function iframePop(obj){
cont=document.getElementById("container")
id=obj.id
oPage=obj.href
if(id!=last_id){
cont.style.left=document.getElementById(id).offsetLeft+offsetX
cont.style.top=document.getElementById(id).offsetTop+offsetY
curposx=document.getElementById(id).offsetLeft-document.body.scrollLeft
if(curposx>=document.body.clientWidth-parseInt(cont.style.width)){
cont.style.left=document.body.clientWidth-parseInt(cont.style.width)+document.body.scrollLeft-offsetX
}
curposy=document.getElementById(id).offsetTop-document.body.scrollTop
if(curposy>=document.body.clientHeight-parseInt(cont.style.height)){
cont.style.top=document.body.clientHeight-parseInt(cont.style.height)-offsetY
}
cont.style.display = "block"
//window["my_iframe"].location=oPage // is added to browsers history list
window["my_iframe"].location.replace(oPage) // not added to browsers history list

setTimeout('document.getElementById("headertxt").innerHTML=window["my_iframe"].document.title',200)
last_id=id
}
else{
cont.style.display = "none"
last_id=""
}
document.getElementById("my_iframe").style.width=parseInt(cont.style.width)
document.getElementById("my_iframe").style.height=parseInt(cont.style.height)-document.getElementById("headertxt").offsetHeight-5
return false
}
// -->
<!-- JavaScript 2010 год --></script>
<style>
.header{width:100%;color:#55FFAA;text-align:center;margin-top:5px;padding-bottom:5px;border-bottom:1px solid #AAAA55;}
.drag{cursor:move;}
</style>
</HEAD>
<BODY>
<DIV id="container" style="position:absolute;left:290px;top:110px;width:460px;height:300px;border:1px solid #A050F0;background-color:#000000;color:#55AAFF;display:none">
<div class="header drag" id="headertxt" onmousedown="dragMe(event,this.offsetParent.id)" title="Hold your left mouse button down to drag">Header</div>
<iframe id="my_iframe" name="my_iframe" src="" style="background-color:#ffffff" frameborder="no"></iframe>
</DIV>

<a href="http://javascript.clan.su" id="lnk1" onclick="return iframePop(this)">iframe 1</a><BR>
<a href="http://javascript.clan.su" id="lnk2" onclick="return iframePop(this)">iframe 2</a><BR>
<a href="http://javascript.clan.su" id="lnk3" onclick="return iframePop(this)">iframe 3</a>
</BODY>
Категория: Фрейм JavaScript | Добавил: Besigor
Просмотров: 2096 | Загрузок: 0 | Комментарии: 2 | Рейтинг: 0.0/0
Всего комментариев: 0
avatar
ONLINE
Онлайн всего: 1
Гостей: 1
Пользователей: 0

Статистика




Бесплатные JavaScript © 2024