diff --git a/.DS_Store b/.DS_Store index 0bcf192..6a67ee0 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/index.html b/index.html index 252c5f2..41855f2 100644 --- a/index.html +++ b/index.html @@ -60,6 +60,21 @@
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+
@@ -71,6 +86,9 @@ + + + diff --git a/js/main.js b/js/main.js index cc56396..dc1c4b2 100644 --- a/js/main.js +++ b/js/main.js @@ -1,16 +1,14 @@ viewStatus= "story" /* data story */ -pages= 0 -totalPages=3; +pagesLoaded= 0 +totalPages=7; window.onload = function() { - console.log("on load") width = 1000, height = 1000; loadPageTemplates() - $('#pagepiling').pagepiling({ menu: null, - anchors: ["page1","page2","page3","page4"], + anchors: ["page1","page2","page3","page4","page5","page6","page7"], direction: 'horizontal', verticalCentered: true, scrollingSpeed: 800, @@ -26,50 +24,37 @@ window.onload = function() { } function loadPageTemplates(){ - console.log("load templates") - $('#page-1').load("templates/page1.html",function(){ - loadModalEvent(1); - counterLoading(); - }) - - $('#page-2').load("templates/page2.html",function(){ - loadModalEvent(2); - counterLoading(); - }) - - $('#page-3').load("templates/page3.html",function(){ - loadModalEvent(3); - counterLoading(); - }) - $('#page-4').load("templates/page4.html",function(){ - loadModalEvent(4); - counterLoading(); - }) - turnEventsOn(); + for (var i=1; i<= totalPages; i++){ + (function (n) { + $('#page-'+n).load("templates/page"+n+".html",function(){ + counterLoading(); + loadModalEvent(n); + }) + })(i) + } + //turnEventsOn(); } -function loadModalEvent( i){ +function loadModalEvent(j){ var modal = new jBox('Modal', { - attach: '#map-btn-page-'+i, - content: $('#map-page-'+i), + attach: '#map-btn-page-'+j, + content: $('#map-page-'+j), closeButton: 'box' }); } function counterLoading(){ - pages++; - - if(pages>totalPages){ + pagesLoaded++; + if(pagesLoaded >= totalPages){ + //Todas las plantillas cargadas $('.menu-content').on("click",'.switchMode', function(e){ - console.log("menu content") if(viewStatus=="story") viewStatus="data" else{ viewStatus="story" } - if(viewStatus=="story"){ $('.story-content').show(); $('.data-content').hide(); diff --git a/templates/page2.html b/templates/page2.html index 7852ffb..f7bbddb 100644 --- a/templates/page2.html +++ b/templates/page2.html @@ -19,7 +19,7 @@
- ver datos + ver mapa
diff --git a/templates/page3.html b/templates/page3.html index 346fbce..1b2e64c 100644 --- a/templates/page3.html +++ b/templates/page3.html @@ -1,12 +1,13 @@
- ver datos + ver mapa
diff --git a/templates/page4.html b/templates/page4.html index 622c0d8..847b026 100644 --- a/templates/page4.html +++ b/templates/page4.html @@ -19,7 +19,7 @@
- ver datos + ver mapa
diff --git a/templates/page5.html b/templates/page5.html new file mode 100644 index 0000000..74898b8 --- /dev/null +++ b/templates/page5.html @@ -0,0 +1,29 @@ +
+
+
+
+
+ +
+ +
+
+
+
+
+ ver mapa +
+
+ +
+ +
diff --git a/templates/page6.html b/templates/page6.html new file mode 100644 index 0000000..6f1c2d1 --- /dev/null +++ b/templates/page6.html @@ -0,0 +1,29 @@ +
+
+
+
+
+ +
+ +
+
+
+
+
+ ver mapa +
+
+ +
+ +
diff --git a/templates/page7.html b/templates/page7.html new file mode 100644 index 0000000..b681f8b --- /dev/null +++ b/templates/page7.html @@ -0,0 +1,29 @@ +
+
+
+
+
+ +
+ +
+
+
+
+
+ ver mapa +
+
+ +
+ +