Показать сообщение отдельно
  #15 (permalink)  
Старый 27.02.2013, 23:06
без статуса
Отправить личное сообщение для Deff Посмотреть профиль Найти все сообщения от Deff
 
Регистрация: 25.05.2012
Сообщений: 8,219

<style>
#Fonaric {
 background-color: #C1D3FB;
 top:100px;
 position:absolute;
}
.Fonaric {
 color:green;
 font-weight:700;
 height:100px;
}
</style>
<body>
<script>
function DopInfo(str){
var d=document.createElement('div');
d.id='Fonaric';
d.className='Fonaric';
d.style.left = "300px";
d.style.width = "200px";
d.style.border = "red solid 1px";
d.style.padding = "12px";
d.innerHTML = str;
document.body.appendChild(d);
}DopInfo('Привет');
</script>


<script>
function Funk0(aa) {
var a=''
var iframe = aa
var iframeDoc = iframe.contentWindow.document;
var b = iframeDoc.createElement('div');
b.innerHTML=a;//alert(b.innerHTML)
iframeDoc.body.appendChild(b);
var s = iframeDoc.createElement('script');
s.setAttribute("type","text/javascript");
s.text='parent.DopInfo("Привет");';

b.appendChild(s);
setTimeout(function() {/*alert('удаляем фрейм');*/aa.parentNode.removeChild(aa)},3000) //Удаляем фрейм
}

</script>
<iframe name=frame1 onload="Funk0(this)"></iframe>

Последний раз редактировалось Deff, 27.02.2013 в 23:30.
Ответить с цитированием