From 2713f5a809e0046ea1e631e0cda3495612aca129 Mon Sep 17 00:00:00 2001 From: Sanj Date: Fri, 11 Nov 2011 23:21:14 +0530 Subject: [PATCH] center projects slider --- urbstudio/static/js/projects.js | 16 ++++++++++++++++ urbstudio/templates/projects.html | 6 +++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/urbstudio/static/js/projects.js b/urbstudio/static/js/projects.js index 5cb484b..93b036f 100755 --- a/urbstudio/static/js/projects.js +++ b/urbstudio/static/js/projects.js @@ -5,6 +5,22 @@ $(function() { return false; }); + $(window).resize(function() { +// var $gall = $('#galleryContainer, .simply-scroll-container'); + var windowWidth = $(window).width(); + var gallWidth = 860; + var leftWidth = 156; +// console.log(windowWidth); + if (windowWidth < 1025) { + return; + } + var newLeft = parseInt((windowWidth - gallWidth) / 2); +// console.log(newLeft); + $('#galleryContainer').animate({'marginLeft': newLeft + "px"}); + $('.simply-scroll-container').animate({'marginLeft': newLeft + "px"}); + }); + + setTimeout("$(window).resize()", 500); $('.projectThumb').click(function() { // alert("hi"); diff --git a/urbstudio/templates/projects.html b/urbstudio/templates/projects.html index 6c3a025..3b993a4 100755 --- a/urbstudio/templates/projects.html +++ b/urbstudio/templates/projects.html @@ -7,9 +7,9 @@ {% block extra_head %} - - - + + +