From 585177bbf2a78504b5843d843392653f280a7605 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 29 Mar 2016 12:42:27 -0400 Subject: update slide number --- db.json | 2 +- public/assets/js/app.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/db.json b/db.json index cb6f87c..3f1a526 100644 --- a/db.json +++ b/db.json @@ -21,7 +21,7 @@ "uri": "http://nytimes.com/" } ], - "__index": 0, + "__index": "0", "dateCreated": "Sat, 26 Mar 2016 20:34:21 GMT", "client": "Annapurna Pictures", "containImage": "true", diff --git a/public/assets/js/app.js b/public/assets/js/app.js index b8992ea..b38d151 100644 --- a/public/assets/js/app.js +++ b/public/assets/js/app.js @@ -38,7 +38,7 @@ var app = (function() { })() -app.init() +// app.init() $(".cell, .next").css({ 'height': ($(".top").height() + 'px') }); @@ -54,6 +54,9 @@ $('.top').flickity({ x2: 40, y2: 25, x3: 15 } +}).on( 'cellSelect', function(e) { + var gallery = $(e.target).data('flickity') + $(".slide-no").html(gallery.selectedIndex + 1) }) $(".previous, .next").css({ 'height': ($(".top").height() + 'px') }); @@ -83,4 +86,4 @@ $(window).resize(function() { $('.top').flickity('resize'); $('body').removeClass('resizing'); }, 400); -}) \ No newline at end of file +}) -- cgit v1.2.3-70-g09d2