Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,25 @@ body {
background-size: cover;
}

.nyc{
background: url(../images/nyc.jpg) no-repeat center center fixed;
}

.sf{
background: url(../images/sf.jpg) no-repeat center center fixed;
}

.la{
background: url(../images/la.jpg) no-repeat center center fixed;
}

austin{
background: url(../images/austin.jpg) no-repeat center center fixed;
}

.sydney{
background: url(../images/sydney.jpg) no-repeat center center fixed;
}

/******************************************
/* LAYOUT
Expand Down
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ <h1>CitiPix</h1>
</div>

<script src="js/jquery-2.1.4.js"></script>
<script src="js/app.js"></script>
</body>
</html>
31 changes: 31 additions & 0 deletions js/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
$(function(){

//On click of the submit button
$("#submit-btn").click(function(){

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mbhat25 nice use of anonymous functions

//console.log("button clicked");
event.preventDefault();
//Capture the city entered
var city = $('#city-type').val();
//console.log(city);

if (city === "NYC" || city === "New York" || city === "New York City"){
$('body').attr('class', 'nyc');
} else if (city === "SF" || city === "San Fransisco" || city === "Bay Area"){
$('body').attr('class', 'sf');
} else if (city === "Los Angeles" || city === "LA" || city === "LAX"){
$('body').attr('class', 'la');
} else if (city === "Austin" || city === "ATX"){
$('body').attr('class', 'austin');
} else if (city === "Sydney" || city === "SYD"){
$('body').attr('class', 'sydney');

} else {
$('body').attr('class', '');
};

$('#city-type').val("");

});

});