Admin Admin
Number of posts : 262 Join date : 08.03.12 Age : 61 Dzīvesvieta : Talsi
| Tēma: YouTube ajax logā (UCOZ) Trešdiena Oktobris 10, 2012 8:39 pm | |
| 1. Taisam .js failu Lai uztaisītu JS failu tad: - atveram notapade - Ieliekam zemāk esošo kodu - saglabājam zem nosaukuma: light.js ar kodējumu UTF-8 Kods ko metam notapedā: - Kods:
-
$(document).ready(function(){ $('.gourl').bind('click', function() { var viewportwidth; var viewportheight; // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight if (typeof window.innerWidth != 'undefined') { viewportwidth = window.innerWidth, viewportheight = window.innerHeight } // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document) else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) { viewportwidth = document.documentElement.clientWidth, viewportheight = document.documentElement.clientHeight } // older versions of IE else { viewportwidth = document.getElementsByTagName('body')[0].clientWidth, viewportheight = document.getElementsByTagName('body')[0].clientHeight } vlink = $(this).attr("href") var yh = viewportheight-20-42; if (yh > 750) {yw=750}; var yw = Math.round((yh-30)*1.7777777); var uh = yh+44; var uw = yw+24; if (uw > viewportwidth-40) { var yw = viewportwidth-40-22; if (yw > 1280) {yw=1280}; var yh = Math.round((yw/1.7777777)+30); var uh = yh+44; var uw = yw+24; } new _uWnd('','Play',uw,uh,{autosize:0,hideonmove:0,fadetype:0,modal:1,resize:0,fadeclosetype:0,closeonesc:1,align:'left'},'<iframe width="'+yw+'" height="'+yh+'" src="'+vlink+'?autoplay=1" frameborder="0" allowfullscreen></iframe>'); return false; }); }); Kad tas ir izdarīts, tad uzkopējam savu JS failiņu uz savu serveri (File Manager) 2. Uzstādām - Kods:
-
<script type="text/javascript" src="/light.js"></script> /light.js ir mūsu uztaisītas failiņš ar savu atrašanās vietu. Vietā kur mums vajag atvērt ajax logu ar video, mēs liekam sekojošu kodu: - Kods:
-
<a class="gourl" href="http://www.youtube.com/embed/uXrmdbGkogs"><img src="http://video.ucoz.com/_ld/0/88.png" /><span class="ucf-play"></span></a> https://www.youtube.com/embed/uXrmdbGkogs - video links http://video.ucoz.com/_ld/0/88.png - pogas bilde (varam nomainīt uz savu, vai aizstāt ar tekstu) VISS! DEMO IR šeit: http://video.ucoz.com/load/system_section/other/ucoz_free_website_builder/35-1-0-88 | |
|