Use simpleWeather jquery plugin with Hype

(Jeroen) #1


I’m trying to use the external simpleWeather jquery plugin with Hype. But I don’t get it to work. I don’t know if I’m doing it in the right way.

I’m using the Bare minimum example:

I use a rectangle called ‘weather’ and id ‘weather’. The js script example will start when scene is loading. I’ve uploaded the compressed (jquery.simpleWeather.min.js) simpleWeather file in Hype. But it doesn’t work. I also included the jquery library but also no luck.

Here is my demo file: (12.4 KB)

Here are the files of the plugin: (30.5 KB)

I hope someone can help me with the script and tell me what I’m doing wrong.


(Mark Hunte) #2

You were missing the JQuery plugging.

But even when I added it I was getting errors

So I linked directly to the weather and jQuery plugins in the head.

 <script src=''></script>
 <script src=''></script>

Also who ever wrote the style code uses html tag in the styles to plant the background image.
This does not work,( within hype) and I have not looked at it too closely but imho is not something I would do.

I changed that to use the #weather id of the rectangle.

Also in the JS they use html as a global var.

I have changed this to
weatherHTML (12.8 KB)

Hype 3 with Simple Weather plugin
(Lucky) #3

did you get the errors because you loaded the jQuery second?
because it works for me
weather-test (47.5 KB)
Also i used this library this week for an ad that called on weather, if you want a hype example of this library being used here’s a source file (285.5 KB)
It gets Toronto’s weather tommorow and because client only had 4 weather state images i had to take yahoo’s conditions and break them down into 4.

var cloud = [0,1,2,3,4,19,20,21,22,23,24,26,27,28,29,30,44]
   ,snow = [5,7,13,14,15,16,17,18,25,41,42,43,46]
   ,sun = [31,32,33,34,36,3200];

(Mark Hunte) #4

Not sure I t man have been a version clash…

(Jeroen) #5

Thanks for the reply’s and suggestions. I’m going to check the new script.
And also thanks for the hype example with the library.
I can go further with the project!