There is divided section widget where we have plugin weather on the right side.
To add weather to any element we inject this code snippet:
1 2 3 |
<div class="ct-dividedWidget-right-title">Weather Now</div> <div id="ct-js-weather" class="ct-weather"></div> </div> |
Javascript markup (in main.js file)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
if(typeof $.simpleWeather === "function"){ $.simpleWeather({ location: 'New York', woeid: '', unit: 'c', success: function(weather) { var html = '<h2><i class="icon-'+weather.code+'"></i> '+weather.temp+'°'+weather.units.temp+'</h2>'; html += '<ul><li>'+weather.city+', '+weather.region+'</li>'; html += '<li class="currently">'+weather.currently+'</li>'; $("#ct-js-weather").html(html); }, error: function(error) { $("#ct-js-weather").html('<p>'+error+'</p>'); } }); } |
To set your location insert the name of the location or the latitude/longitude param.
Script Source
1 |
<script src="../assets/js/jquery.simpleWeather.min.js"></script> |