JWeather
A jQuery plugin used to display the current weather of any city using Yahoo-Weather. Visit www.deskode.com
Getting started
As you can see in the example files, you will need to include:
-
jQuery library. (1.6.0 minimum)
-
The JavaScript file
jweather.js
(or its minified versionjweather.min.js
) -
The css file
jweather.css
Install using bower or npm
Optionally, you can install jweather.js with bower or npm if you prefer:
Terminal:
// With bowerbower install JWeather // With npmnpm install jweather
Including files:
<!-- include jweather.css and copy the font folder to one folder above your /css folder --><!-- include a copy of jquery (if you haven't already) --> <!-- include jweather -->
Required HTML structure
Have a target for where you want it shown
Initialization
All you need to do is call JWeather.js inside a $(document).ready
function:
;
Configuration Options
JWeather provides some options that allow customization of the plugin's functionality. The default options are overridden by passing an object into the jweather function.
Option | Values | Default | Description |
---|---|---|---|
location |
City, State |
Nuevo Casas Grandes, CH |
city and region *required |
view |
simple ,today ,forecast ,full |
full |
there are plenty of display options that will let you customize the widget for your particular application |
forecast |
0-5 |
5 |
how many days you want forecast |
render |
true or false |
true |
if you want plugin to generate markup |
units |
metric or imperial |
metric |
force metric units |
language |
español ,italiano ,français ,deutsch ,english |
english |
change the language |
Example usage:
;
Views Configuration
Full
;
Simple
;
Today
;
Forecast
;
Render False
;
Reporting issues
- Please, look for your issue before asking using the github issues search.
- Make sure you use the latest JWeather version. No support is provided for older versions.
- Use the the Github Issues forum to create issues.
Changelog
To see the list of recent changes, see Releases section.
Donations
Donations would be more than welcome :)
License
The credit comments in the JavaScript and CSS files should be kept intact (even after combination or minification )
(The MIT License)
Copyright (c) 2017 Ivan Sotelo
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.