Luksus
Laipni lūdzu forumā "Luksus"
Lūdzu REĢISTRĒJIES vai IELOGOJIES!
Luksus
Laipni lūdzu forumā "Luksus"
Lūdzu REĢISTRĒJIES vai IELOGOJIES!
Luksus
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Luksus

Daudzas lietas kas varētu interesēt daudzus.
 
SatursPortalGalleryLatest imagesMeklētReģistrētiesIeiet

 

 YouTube ajax logā (UCOZ)

Go down 
AutorsZiņojums
Admin
Admin
Admin


Number of posts : 262
Join date : 08.03.12
Age : 61
Dzīvesvieta : Talsi

YouTube ajax logā (UCOZ) Empty
PostTēma: YouTube ajax logā (UCOZ)   YouTube ajax logā (UCOZ) Icon_minitimeTreš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

YouTube ajax logā (UCOZ) 26045310

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

YouTube ajax logā (UCOZ) 8810

Atpakaļ uz augšu Go down
https://luksus.latvianforum.net
 
YouTube ajax logā (UCOZ)
Atpakaļ uz augšu 
Lapa 1 no 1
 Similar topics
-
» Ajax loga izskats (UCOZ)
» Filmu Pieprasijums AJAX logā. (UCOZ)
» Foruma pielikumu atvēršana AJAX logā (UCOZ)
» Foruma tēmu priekšskatījums ajax logā (UCOZ)
» Attēls pilnā izmērā ajax logā (UCOZ)

Permissions in this forum:Jūs nevarat atbildēt tematos šajā forumā
Luksus :: Materiāli :: Skripti-
Pāriet uz: