|
479 | 479 | var keydownId;
|
480 | 480 |
|
481 | 481 | if($(this).length){
|
482 |
| - init(); |
| 482 | + init(); |
483 | 483 | }
|
484 | 484 |
|
485 | 485 | function init(){
|
486 |
| - container.css({ |
487 |
| - 'height': '100%', |
488 |
| - 'position': 'relative' |
489 |
| - }); |
490 |
| - |
491 |
| - //adding a class to recognize the container internally in the code |
492 |
| - container.addClass(WRAPPER); |
493 |
| - $('html').addClass(ENABLED); |
494 |
| - |
495 |
| - //if css3 is not supported, it will use jQuery animations |
496 |
| - if(options.css3){ |
497 |
| - options.css3 = support3d(); |
498 |
| - } |
499 |
| - |
500 |
| - FP.setAllowScrolling(true); |
501 |
| - container.removeClass(DESTROYED); //in case it was destroyed before initilizing it again |
502 |
| - |
503 |
| - addInternalSelectors(); |
504 |
| - |
505 |
| - //styling the sections / slides / menu |
506 |
| - $(SECTION_SEL).each(function(index){ |
507 |
| - var section = $(this); |
508 |
| - var slides = section.find(SLIDE_SEL); |
509 |
| - var numSlides = slides.length; |
510 |
| - |
511 |
| - styleSection(section, index); |
512 |
| - styleMenu(section, index); |
513 |
| - |
514 |
| - // if there's any slide |
515 |
| - if (numSlides > 0) { |
516 |
| - styleSlides(section, slides, numSlides); |
517 |
| - }else{ |
518 |
| - if(options.verticalCentered){ |
519 |
| - addTableClass(section); |
520 |
| - } |
521 |
| - } |
522 |
| - }); |
| 486 | + container.css({ |
| 487 | + 'height': '100%', |
| 488 | + 'position': 'relative' |
| 489 | + }); |
| 490 | + |
| 491 | + //adding a class to recognize the container internally in the code |
| 492 | + container.addClass(WRAPPER); |
| 493 | + $('html').addClass(ENABLED); |
| 494 | + |
| 495 | + //if css3 is not supported, it will use jQuery animations |
| 496 | + if(options.css3){ |
| 497 | + options.css3 = support3d(); |
| 498 | + } |
| 499 | + |
| 500 | + FP.setAllowScrolling(true); |
| 501 | + container.removeClass(DESTROYED); //in case it was destroyed before initilizing it again |
| 502 | + |
| 503 | + addInternalSelectors(); |
| 504 | + |
| 505 | + //styling the sections / slides / menu |
| 506 | + $(SECTION_SEL).each(function(index){ |
| 507 | + var section = $(this); |
| 508 | + var slides = section.find(SLIDE_SEL); |
| 509 | + var numSlides = slides.length; |
| 510 | + |
| 511 | + styleSection(section, index); |
| 512 | + styleMenu(section, index); |
| 513 | + |
| 514 | + // if there's any slide |
| 515 | + if (numSlides > 0) { |
| 516 | + styleSlides(section, slides, numSlides); |
| 517 | + }else{ |
| 518 | + if(options.verticalCentered){ |
| 519 | + addTableClass(section); |
| 520 | + } |
| 521 | + } |
| 522 | + }); |
523 | 523 |
|
524 | 524 | FP.setAutoScrolling(options.autoScrolling, 'internal');
|
525 | 525 |
|
|
538 | 538 |
|
539 | 539 | //vertical centered of the navigation + active bullet
|
540 | 540 | if(options.navigation){
|
541 |
| - addVerticalNavigation(); |
| 541 | + addVerticalNavigation(); |
542 | 542 | }
|
543 | 543 |
|
544 | 544 | if(options.scrollOverflow){
|
|
594 | 594 | * Styles the horizontal slides for a section.
|
595 | 595 | */
|
596 | 596 | function styleSlides(section, slides, numSlides){
|
597 |
| - var sliderWidth = numSlides * 100; |
| 597 | + var sliderWidth = numSlides * 100; |
598 | 598 | var slideWidth = 100 / numSlides;
|
599 | 599 |
|
600 | 600 | slides.wrapAll('<div class="' + SLIDES_CONTAINER + '" />');
|
|
661 | 661 | * Sets the data-anchor attributes to the menu elements and activates the current one.
|
662 | 662 | */
|
663 | 663 | function styleMenu(section, index){
|
664 |
| - if (typeof options.anchors[index] !== 'undefined') { |
| 664 | + if (typeof options.anchors[index] !== 'undefined') { |
665 | 665 | section.attr('data-anchor', options.anchors[index]);
|
666 | 666 |
|
667 | 667 | //activating the menu / nav element on load
|
|
681 | 681 | * keeping the link with the style sheet.
|
682 | 682 | */
|
683 | 683 | function addInternalSelectors(){
|
684 |
| - //adding internal class names to void problem with common ones |
685 |
| - $(options.sectionSelector).each(function(){ |
686 |
| - $(this).addClass(SECTION); |
687 |
| - }); |
688 |
| - $(options.slideSelector).each(function(){ |
689 |
| - $(this).addClass(SLIDE); |
690 |
| - }); |
| 684 | + //adding internal class names to void problem with common ones |
| 685 | + $(options.sectionSelector).each(function(){ |
| 686 | + $(this).addClass(SECTION); |
| 687 | + }); |
| 688 | + $(options.slideSelector).each(function(){ |
| 689 | + $(this).addClass(SLIDE); |
| 690 | + }); |
691 | 691 | }
|
692 | 692 |
|
693 | 693 | /**
|
|
710 | 710 | * Creates a vertical navigation bar.
|
711 | 711 | */
|
712 | 712 | function addVerticalNavigation(){
|
713 |
| - var nav = $(SECTION_NAV_SEL); |
| 713 | + var nav = $(SECTION_NAV_SEL); |
714 | 714 | $body.append('<div id="' + SECTION_NAV + '"><ul></ul></div>');
|
715 | 715 |
|
716 | 716 | nav.addClass(function() {
|
|
0 commit comments