Skip to content

Commit

Permalink
Fixed issue # 22
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanstewart committed Apr 27, 2012
1 parent 1a6245f commit 33db6d4
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions src/www/js/main.js
Expand Up @@ -31,27 +31,35 @@ require(
slideViewport($(event.target).data().view); slideViewport($(event.target).data().view);
}); });


$(".viewcontainer").removeClass("viewhidden"); // Show the view containers.
$(".viewcontainer").removeClass("viewhidden");


// Set the viewport height/width
$('#viewport').width($(window).width()); $('#viewport').width($(window).width());
$('#viewport').height($(window).height()-40); //height of the header $('#viewport').height($(window).height()-40); //height of the header


viewportWidth = $("#viewport").width();
// The viewportWidth variable is used to track changes on resize as
// well as keeping track of the width for moving the divs around.
viewportWidth = $("#viewport").width();


var numberOfViews = $("#slidecontainer").children().length; // This figures out how many views we have and then we set up the size
// of the #slidecontainer based on the number of views we have.
var numberOfViews = $("#slidecontainer").children().length;
$("#slidecontainer").width(numberOfViews * viewportWidth); $("#slidecontainer").width(numberOfViews * viewportWidth);
$("#slidecontainer").children().each(function() { $("#slidecontainer").children().each(function() {
$(this).width(viewportWidth); $(this).width(viewportWidth);
}); });


$(window).resize(function() { $(window).resize(function() {
var win_width = $(window).width();
var win_height = $(window).height();


$('#viewport').width(win_width); // Figure out the current window height/width after we resize it.
$('#viewport').height(win_height-40); //height of the header var win_width = $(window).width();
var win_height = $(window).height();


viewportWidth = $('#viewport').width(); // set the viewportWidth variable because we're going to use it to
// resize the children (views) of the #slidecontainer
viewportWidth = $('#viewport').width();


$("#slidecontainer").width(numberOfViews * viewportWidth); $("#slidecontainer").width(numberOfViews * viewportWidth);
$("#slidecontainer").children().each(function() { $("#slidecontainer").children().each(function() {
Expand Down

0 comments on commit 33db6d4

Please sign in to comment.