Browse files

complete

  • Loading branch information...
1 parent d1d61b1 commit 37cef7358cf928f5d6d1ede07518696b70464987 Marcello Romanelli committed Aug 24, 2012
Showing with 34 additions and 15 deletions.
  1. +4 −0 public/applications/weather/css/small.css
  2. +30 −15 public/applications/weather/js/ws_small.js
View
4 public/applications/weather/css/small.css
@@ -40,6 +40,10 @@ h2 {
height: 450px;
padding: 30px;
margin: 80px auto 10px auto;
+ margin-top: 80px;
+ margin-right: auto;
+ margin-left: auto;
+ margin-bottom: 10px;
background-color: rgba(0, 0, 0, 0.6);
}
View
45 public/applications/weather/js/ws_small.js
@@ -45,7 +45,6 @@ $(function() {
function updateFirst(response,cityname){
var city = $("#first");
- var original = city.css("margin");
city.animate({"margin-left": "-530px"},'slow',function(){
@@ -59,25 +58,41 @@ function updateFirst(response,cityname){
$("#first_maxtemp").html(response.forecast[0].high_temperature + "º");
$("#first_mintemp").html(response.forecast[0].low_temperature + "º");
});
-
- city.animate({"margin": original},'fast');
+
+ city.animate({"margin-left": "auto"},'fast');
city.effect("bounce", {direction:'left', times:3 }, 300);
}
function updateSecond(response,cityname){
- $("#second_img").attr("src","css/small_icons/"+response.condition.code +".png")
- freeCity($("#second_location").html());
- $("#second_location").html(cityname);
- $("#second_current_temp").html(response.condition.temperature + "º");
- $("#second_maxtemp").html(response.forecast[0].high_temperature + "º");
- $("#second_mintemp").html(response.forecast[0].low_temperature + "º");
+ var city = $($(".other").get(0));
+ var original = city.css("margin-top");
+ city.animate({"margin-left": "-530px"},'slow',function(){
+
+
+ $("#second_img").attr("src","css/small_icons/"+response.condition.code +".png")
+ freeCity($("#second_location").html());
+ $("#second_location").html(cityname);
+ $("#second_current_temp").html(response.condition.temperature + "º");
+ $("#second_maxtemp").html(response.forecast[0].high_temperature + "º");
+ $("#second_mintemp").html(response.forecast[0].low_temperature + "º");
+ });
+
+ city.animate({"margin-left": "auto"},'fast');
+ city.effect("bounce", {direction:'left', times:3 }, 300);
}
+
function updateThird(response,cityname){
- $("#third_img").attr("src","css/small_icons/"+response.condition.code +".png")
- freeCity($("#third_location").html());
- $("#third_location").html(cityname);
- $("#third_current_temp").html(response.condition.temperature + "º");
- $("#third_maxtemp").html(response.forecast[0].high_temperature + "º");
- $("#third_mintemp").html(response.forecast[0].low_temperature + "º");
+ var city = $($(".other").get(1));
+ var original = city.css("margin-top");
+ city.animate({"margin-left": "-530px"},'slow',function(){
+ $("#third_img").attr("src","css/small_icons/"+response.condition.code +".png")
+ freeCity($("#third_location").html());
+ $("#third_location").html(cityname);
+ $("#third_current_temp").html(response.condition.temperature + "º");
+ $("#third_maxtemp").html(response.forecast[0].high_temperature + "º");
+ $("#third_mintemp").html(response.forecast[0].low_temperature + "º");
+ });
+ city.animate({"margin-left": "auto"},'fast');
+ city.effect("bounce", {direction:'left', times:3 }, 300);
}

0 comments on commit 37cef73

Please sign in to comment.