Spaces:
Running
Running
Update js/js.php
Browse files
js/js.php
CHANGED
@@ -102,6 +102,7 @@ function isPlaying($ref) {
|
|
102 |
}
|
103 |
|
104 |
|
|
|
105 |
// Returns true if $elem is beyond the current scrolled view.
|
106 |
function isScrolledOutOfView($elem) {
|
107 |
var $window = $(window);
|
@@ -113,7 +114,7 @@ function isScrolledOutOfView($elem) {
|
|
113 |
var elemBottom = elemTop + $elem.height();
|
114 |
|
115 |
return ((elemBottom > windowBottom) || (elemTop < windowTop));
|
116 |
-
}
|
117 |
|
118 |
// Callback function for timeupdate event.
|
119 |
function updatePosition( currentTime ) {
|
@@ -124,12 +125,12 @@ function updatePosition( currentTime ) {
|
|
124 |
notPlaying($( 'span[name=utterance]' )); // Mark everything as "not playing".
|
125 |
isPlaying($( '#' + intervals[c].begin )); // Mark line corresponding to currentTime as "playing".
|
126 |
|
127 |
-
|
128 |
if (isScrolledOutOfView($('.playing'))) {
|
129 |
$('html, body').animate({
|
130 |
scrollTop: ($(".playing").offset().top - ($(window).height() / 2))
|
131 |
}, 500);
|
132 |
-
}
|
133 |
}
|
134 |
//$( 'span[name=utterance]' ).removeClass('uttPlaying'); // No interval defined at currentTime.
|
135 |
}
|
|
|
102 |
}
|
103 |
|
104 |
|
105 |
+
/*
|
106 |
// Returns true if $elem is beyond the current scrolled view.
|
107 |
function isScrolledOutOfView($elem) {
|
108 |
var $window = $(window);
|
|
|
114 |
var elemBottom = elemTop + $elem.height();
|
115 |
|
116 |
return ((elemBottom > windowBottom) || (elemTop < windowTop));
|
117 |
+
} */
|
118 |
|
119 |
// Callback function for timeupdate event.
|
120 |
function updatePosition( currentTime ) {
|
|
|
125 |
notPlaying($( 'span[name=utterance]' )); // Mark everything as "not playing".
|
126 |
isPlaying($( '#' + intervals[c].begin )); // Mark line corresponding to currentTime as "playing".
|
127 |
|
128 |
+
/* // Auto-scroll if playing line is out of view.
|
129 |
if (isScrolledOutOfView($('.playing'))) {
|
130 |
$('html, body').animate({
|
131 |
scrollTop: ($(".playing").offset().top - ($(window).height() / 2))
|
132 |
}, 500);
|
133 |
+
} */
|
134 |
}
|
135 |
//$( 'span[name=utterance]' ).removeClass('uttPlaying'); // No interval defined at currentTime.
|
136 |
}
|