|
269 | 269 | $htmlBody.scrollTop(element.position().top);
|
270 | 270 | }
|
271 | 271 | }
|
272 |
| - }; |
| 272 | + } |
273 | 273 |
|
274 | 274 | /**
|
275 | 275 | * Defines wheter to record the history for each hash change in the URL.
|
276 | 276 | */
|
277 | 277 | function setRecordHistory(value, type){
|
278 | 278 | setVariableState('recordHistory', value, type);
|
279 |
| - }; |
| 279 | + } |
280 | 280 |
|
281 | 281 | /**
|
282 | 282 | * Defines the scrolling speed
|
283 | 283 | */
|
284 | 284 | function setScrollingSpeed(value, type){
|
285 | 285 | setVariableState('scrollingSpeed', value, type);
|
286 |
| - }; |
| 286 | + } |
287 | 287 |
|
288 | 288 | /**
|
289 | 289 | * Sets fitToSection
|
290 | 290 | */
|
291 | 291 | function setFitToSection(value, type){
|
292 | 292 | setVariableState('fitToSection', value, type);
|
293 |
| - }; |
| 293 | + } |
294 | 294 |
|
295 | 295 | /**
|
296 | 296 | * Sets lockAnchors
|
297 | 297 | */
|
298 | 298 | function setLockAnchors(value){
|
299 | 299 | options.lockAnchors = value;
|
300 |
| - }; |
| 300 | + } |
301 | 301 |
|
302 | 302 | /**
|
303 | 303 | * Adds or remove the possiblity of scrolling through sections by using the mouse wheel or the trackpad.
|
|
310 | 310 | removeMouseWheelHandler();
|
311 | 311 | removeMiddleWheelHandler();
|
312 | 312 | }
|
313 |
| - }; |
| 313 | + } |
314 | 314 |
|
315 | 315 | /**
|
316 | 316 | * Adds or remove the possiblity of scrolling through sections by using the mouse wheel/trackpad or touch gestures.
|
|
333 | 333 | setMouseWheelScrolling(false);
|
334 | 334 | removeTouchHandler();
|
335 | 335 | }
|
336 |
| - }; |
| 336 | + } |
337 | 337 |
|
338 | 338 | /**
|
339 | 339 | * Adds or remove the possiblity of scrolling through sections by using the keyboard arrow keys
|
|
348 | 348 | }else{
|
349 | 349 | options.keyboardScrolling = value;
|
350 | 350 | }
|
351 |
| - }; |
| 351 | + } |
352 | 352 |
|
353 | 353 | /**
|
354 | 354 | * Moves the page up one section.
|
|
364 | 364 | if (prev.length) {
|
365 | 365 | scrollPage(prev, null, true);
|
366 | 366 | }
|
367 |
| - }; |
| 367 | + } |
368 | 368 |
|
369 | 369 | /**
|
370 | 370 | * Moves the page down one section.
|
|
381 | 381 | if(next.length){
|
382 | 382 | scrollPage(next, null, false);
|
383 | 383 | }
|
384 |
| - }; |
| 384 | + } |
385 | 385 |
|
386 | 386 | /**
|
387 | 387 | * Moves the page to the given section and slide with no animation.
|
|
391 | 391 | setScrollingSpeed (0, 'internal');
|
392 | 392 | moveTo(sectionAnchor, slideAnchor);
|
393 | 393 | setScrollingSpeed (originals.scrollingSpeed, 'internal');
|
394 |
| - }; |
| 394 | + } |
395 | 395 |
|
396 | 396 | /**
|
397 | 397 | * Moves the page to the given section and slide.
|
|
405 | 405 | }else if(destiny.length > 0){
|
406 | 406 | scrollPage(destiny);
|
407 | 407 | }
|
408 |
| - }; |
| 408 | + } |
409 | 409 |
|
410 | 410 | /**
|
411 | 411 | * Slides right the slider of the active section.
|
412 | 412 | * Optional `section` param.
|
413 | 413 | */
|
414 | 414 | function moveSlideRight(section){
|
415 | 415 | moveSlide('right', section);
|
416 |
| - }; |
| 416 | + } |
417 | 417 |
|
418 | 418 | /**
|
419 | 419 | * Slides left the slider of the active section.
|
420 | 420 | * Optional `section` param.
|
421 | 421 | */
|
422 | 422 | function moveSlideLeft(section){
|
423 | 423 | moveSlide('left', section);
|
424 |
| - }; |
| 424 | + } |
425 | 425 |
|
426 | 426 | /**
|
427 | 427 | * When resizing is finished, we adjust the slides sizes and positions
|
|
473 | 473 | isResizing = false;
|
474 | 474 | $.isFunction( options.afterResize ) && resizing && options.afterResize.call(container);
|
475 | 475 | $.isFunction( options.afterReBuild ) && !resizing && options.afterReBuild.call(container);
|
476 |
| - }; |
| 476 | + } |
477 | 477 |
|
478 | 478 | /**
|
479 | 479 | * Turns fullPage.js to normal scrolling mode when the viewport `width` or `height`
|
|
498 | 498 | $body.removeClass(RESPONSIVE);
|
499 | 499 | $.isFunction( options.afterResponsive ) && options.afterResponsive.call( container, active);
|
500 | 500 | }
|
501 |
| - }; |
| 501 | + } |
502 | 502 |
|
503 | 503 | function getFullpageData(){
|
504 | 504 | return {
|
|
516 | 516 | styleSlides: styleSlides
|
517 | 517 | }
|
518 | 518 | };
|
519 |
| - }; |
| 519 | + } |
520 | 520 |
|
521 | 521 | if($(this).length){
|
522 | 522 | //public functions
|
|
974 | 974 | var anchorLink = currentSection.data('anchor');
|
975 | 975 | var sectionIndex = currentSection.index(SECTION_SEL) + 1;
|
976 | 976 | var activeSlide = currentSection.find(SLIDE_ACTIVE_SEL);
|
| 977 | + var slideIndex; |
| 978 | + var slideAnchorLink; |
977 | 979 |
|
978 | 980 | if(activeSlide.length){
|
979 |
| - var slideAnchorLink = activeSlide.data('anchor'); |
980 |
| - var slideIndex = activeSlide.index(); |
| 981 | + slideAnchorLink = activeSlide.data('anchor'); |
| 982 | + slideIndex = activeSlide.index(); |
981 | 983 | }
|
982 | 984 |
|
983 | 985 | if(canScroll){
|
|
1380 | 1382 | if(typeof element === 'undefined'){ return; } //there's no element to scroll, leaving the function
|
1381 | 1383 |
|
1382 | 1384 | var dtop = getDestinationPosition(element);
|
| 1385 | + var slideAnchorLink; |
| 1386 | + var slideIndex; |
1383 | 1387 |
|
1384 | 1388 | //local variables
|
1385 | 1389 | var v = {
|
|
1403 | 1407 | if((v.activeSection.is(element) && !isResizing) || (options.scrollBar && $window.scrollTop() === v.dtop && !element.hasClass(AUTO_HEIGHT) )){ return; }
|
1404 | 1408 |
|
1405 | 1409 | if(v.activeSlide.length){
|
1406 |
| - var slideAnchorLink = v.activeSlide.data('anchor'); |
1407 |
| - var slideIndex = v.activeSlide.index(); |
| 1410 | + slideAnchorLink = v.activeSlide.data('anchor'); |
| 1411 | + slideIndex = v.activeSlide.index(); |
1408 | 1412 | }
|
1409 | 1413 |
|
1410 | 1414 | // If continuousVertical && we need to wrap around
|
|
1583 | 1587 | * Lazy loads image, video and audio elements.
|
1584 | 1588 | */
|
1585 | 1589 | function lazyLoad(destiny){
|
1586 |
| - var destiny = getSlideOrSection(destiny); |
| 1590 | + var panel = getSlideOrSection(destiny); |
1587 | 1591 |
|
1588 |
| - destiny.find('img[data-src], source[data-src], audio[data-src], iframe[data-src]').each(function(){ |
| 1592 | + panel.find('img[data-src], source[data-src], audio[data-src], iframe[data-src]').each(function(){ |
1589 | 1593 | $(this).attr('src', $(this).data('src'));
|
1590 | 1594 | $(this).removeAttr('data-src');
|
1591 | 1595 |
|
|
1599 | 1603 | * Plays video and audio elements.
|
1600 | 1604 | */
|
1601 | 1605 | function playMedia(destiny){
|
1602 |
| - var destiny = getSlideOrSection(destiny); |
| 1606 | + var panel = getSlideOrSection(destiny); |
1603 | 1607 |
|
1604 | 1608 | //playing HTML5 media elements
|
1605 |
| - destiny.find('video, audio').each(function(){ |
| 1609 | + panel.find('video, audio').each(function(){ |
1606 | 1610 | var element = $(this).get(0);
|
1607 | 1611 |
|
1608 | 1612 | if( element.hasAttribute('data-autoplay') && typeof element.play === 'function' ) {
|
|
1611 | 1615 | });
|
1612 | 1616 |
|
1613 | 1617 | //youtube videos
|
1614 |
| - destiny.find('iframe[src*="youtube.com/embed/"]').each(function(){ |
| 1618 | + panel.find('iframe[src*="youtube.com/embed/"]').each(function(){ |
1615 | 1619 | var element = $(this).get(0);
|
1616 | 1620 |
|
1617 | 1621 | if ( element.hasAttribute('data-autoplay') ){
|
|
1632 | 1636 | */
|
1633 | 1637 | function playYoutube(element){
|
1634 | 1638 | element.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*');
|
1635 |
| - }; |
| 1639 | + } |
1636 | 1640 |
|
1637 | 1641 | /**
|
1638 | 1642 | * Stops video and audio elements.
|
1639 | 1643 | */
|
1640 | 1644 | function stopMedia(destiny){
|
1641 |
| - var destiny = getSlideOrSection(destiny); |
| 1645 | + var panel = getSlideOrSection(destiny); |
1642 | 1646 |
|
1643 | 1647 | //stopping HTML5 media elements
|
1644 |
| - destiny.find('video, audio').each(function(){ |
| 1648 | + panel.find('video, audio').each(function(){ |
1645 | 1649 | var element = $(this).get(0);
|
1646 | 1650 |
|
1647 | 1651 | if( !element.hasAttribute('data-keepplaying') && typeof element.pause === 'function' ) {
|
|
1650 | 1654 | });
|
1651 | 1655 |
|
1652 | 1656 | //youtube videos
|
1653 |
| - destiny.find('iframe[src*="youtube.com/embed/"]').each(function(){ |
| 1657 | + panel.find('iframe[src*="youtube.com/embed/"]').each(function(){ |
1654 | 1658 | var element = $(this).get(0);
|
1655 | 1659 |
|
1656 | 1660 | if( /youtube\.com\/embed\//.test($(this).attr('src')) && !element.hasAttribute('data-keepplaying')){
|
|
1827 | 1831 | moveSectionUp();
|
1828 | 1832 | break;
|
1829 | 1833 | }
|
| 1834 | + /* falls through */ |
1830 | 1835 | case 40:
|
1831 | 1836 | case 34:
|
1832 | 1837 | if(isScrollAllowed.k.down){
|
|
2694 | 2699 | if(all){
|
2695 | 2700 | destroyStructure();
|
2696 | 2701 | }
|
2697 |
| - }; |
| 2702 | + } |
2698 | 2703 |
|
2699 | 2704 | /*
|
2700 | 2705 | * Removes inline styles added by fullpage.js
|
|
0 commit comments