Помогите доработать хороший скрипт!
Здрасти! скрипт создает html страницу определенного размера и с определенными параметрами и открувает ее строго в центре экрана (определив предварительно его разрешение) и вставляет в эту страницу картинку... Я никак не могу его переделать так, чтобы он открывал в новом окне не картинку а флесшку (вернее видео ролик с ютуб) Помогите плиз!
основная страница: <html><head><title>бла бла бла</title> <script type="text/javascript" src="script.js"></script> </head><body> -------------------------------------------------- <a href="bllllaaaa.jpg" onclick="win('bllllaaaa.jpg',298, 445,'');return(false);"><img src="pr_bllllaaaa.jpg"></a> -------------------------------------------------- </body></html> Вот собсна сам фаил скрипта (script.js) : function win(ID,w,h,tit) { var wnd01, tPage, wndHeight, wndWidth, imgHeight; nleft='5' ntop='5' if ( w>0 && h>0 ) { nleft=screen.width/2-(w/2) ntop=screen.height/2-(h/2) } wnd01 = window.open('','_blank','copyhistory=no,directorie s=no,location=no,status=no,scrollbars=no,menubar=n o,toolbar=no,left='+nleft+',top='+ntop+',resizable =yes,width='+w+',height='+h); tPage=""; tPage=tPage+"<html>\n"; tPage=tPage+"<head>\n"; tPage=tPage+"<title>ббллаааа</title>\n"; tPage=tPage+"<\/head>\n"; tPage=tPage+"<body TEXT='#A8882C' LINK='#946619' VLINK='#573C0E' ALINK='#000000' bgcolor='#000000' marginwidth='0' marginheight='0' topmargin='0' leftmargin='0'>\n"; tPage=tPage+"<center><img "+"style=\"cursor: pointer; cursor: hand;vertical-align: center\"; margin: 0"+" src=\""+ID+"\" return false;' alt='"+tit+"'><\/center>"; tPage=tPage+"<\/body>\n"; tPage=tPage+"<\/html>\n"; wnd01.document.write(tPage); } Так вот ... нужно переделать фаил скрипта script.js чтобы если ввести в основную страницу: <html><head><title>бла бла бла</title> <script type="text/javascript" src="script.js"></script> </head><body> -------------------------------------------------- <a href="<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/UQ_o-9xmh_g&hl=ru&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/UQ_o-9xmh_g&hl=ru&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>" onclick="win('<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/UQ_o-9xmh_g&hl=ru&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/UQ_o-9xmh_g&hl=ru&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>',298, 445,'');return(false);"><img src="pr_bllllaaaa.jpg"></a> -------------------------------------------------- </body></html> в новом окне открывался данные флесш ролик |
Ну вместо <img…> поместите код Flash-плеера с YouTube
|
пробовал! не получается
Нееааа... не получится... это было первое что я попробовал!))) нужно както изменить фаил скрипт
|
<html><head><title>бла бла бла</title> <script type="text/javascript" src="script.js"></script> </head><body> -------------------------------------------------- <img src="blaa.jpg" onclick='win(inputElem,298,445);return(false)'> -------------------------------------------------- </body></html> var inputElem= '<object width="425" height="344">'+ '<param name="movie" value="http://www.youtube.com/v/UQ_o-9xmh_g&hl=ru&fs=1&"></param>'+ '<param name="allowFullScreen" value="true"></param>'+ '<param name="allowscriptaccess" value="always"></param>'+ '<embed src="http://www.youtube.com/v/UQ_o-9xmh_g&hl=ru&fs=1&"'+ 'type="application/x-shockwave-flash" allowscriptaccess="always"'+ 'allowfullscreen="true" width="425" height="344"></embed>'+ '</object>' function win(ID,w,h) { var wnd01, tPage, wndHeight, wndWidth, imgHeight; nleft='5' ntop='5' if ( w>0 && h>0 ) { nleft=screen.width/2-(w/2) ntop=screen.height/2-(h/2) } wnd01 = window.open('','_blank','copyhistory=no,directorie s=no,location=no,status=no,scrollbars=no,menubar=n o,toolbar=no,left='+nleft+',top='+ntop+',resizable =yes,width='+w+',height='+h); tPage=""; tPage=tPage+"<html>\n"; tPage=tPage+"<head>\n"; tPage=tPage+"<title>ббллаааа</title>\n"; tPage=tPage+"<\/head>\n"; tPage=tPage+"<body TEXT='#A8882C' LINK='#946619' VLINK='#573C0E' ALINK='#000000' bgcolor='#000000' marginwidth='0' marginheight='0' topmargin='0' leftmargin='0'>\n"; tPage=tPage+"<center>"+ID+"<\/center>"; tPage=tPage+"<\/body>\n"; tPage=tPage+"<\/html>\n"; wnd01.document.write(tPage); } |
Часовой пояс GMT +3, время: 02:44. |