Total Complexity | 5 |
Complexity/F | 1.25 |
Lines of Code | 42 |
Function Count | 4 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | // When scroll down change opacity of the title |
||
2 | jQuery(window).scroll(function(event){ |
||
|
|||
3 | var fromTop = (jQuery(window).scrollTop()); |
||
4 | var offSet = 1 - (fromTop * 0.006); |
||
5 | //console.log(offSet); |
||
6 | jQuery('.lifeVideo .container').css('opacity', offSet); |
||
7 | |||
8 | |||
9 | }); |
||
10 | |||
11 | |||
12 | // When resize the window scale the youtube video according with window width |
||
13 | function resizeYoutubeVideoFrame(windowWidth){ |
||
14 | var windowWidth = jQuery(window).width(); // returns width of browser viewport |
||
15 | var videoHeight = windowWidth/16*9; |
||
16 | jQuery('.lifeVideo.youtube .t-cover__carrier iframe').width(windowWidth); |
||
17 | jQuery('.lifeVideo.youtube .t-cover__carrier iframe').height(videoHeight); |
||
18 | jQuery('.lifeVideo.youtube').height(videoHeight); |
||
19 | //alert("Window width: "+windowWidth); |
||
20 | } |
||
21 | |||
22 | // Resize video - on first page loading |
||
23 | var windowWidth = jQuery(window).width(); |
||
24 | resizeYoutubeVideoFrame(windowWidth); |
||
25 | |||
26 | |||
27 | // Resize video - when the use resize the window |
||
28 | jQuery(window).resize(function() { |
||
29 | var windowWidth = jQuery(window).width(); |
||
30 | resizeYoutubeVideoFrame(windowWidth); |
||
31 | }); |
||
32 | |||
33 | |||
34 | $(function () { |
||
35 | if (/Mobi/i.test(navigator.userAgent) || /Android/i.test(navigator.userAgent)) { |
||
36 | console.log( "mobile!" ); |
||
37 | $(".lifeVideo.youtube").remove(); |
||
38 | } |
||
39 | else{ |
||
40 | console.log( "desktop!" ); |
||
41 | $(".lifeVideo.local_vertical").remove(); |
||
42 | } |
||
43 | }); |
||
44 |
This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.