Is is possible to change the forecast scroll speed?

Sometimes a lengthy forecast cannot be read before being replaced by “Downloading” as the gauges update.

I know I can lengthen the download times & I have already increased it from 6 to 10 seconds. Increasing it any further would detract from the “live” nature of the gauges.

If the text scrolled more quickly then that would solve it…is this possible?

Cheers,

Simon, it isn’t a configurable option via a public method in the library. You will have to edit the SteelSeries library to achieve this.

In the un-minimised steelseries.js look at line 2163

                scrollX += 2;

This sets the number of pixels (2) that the text moves each update. You can increase this value.
and/or (perhaps less desirable) you can increase the update speed at line 2164

                scrollTimer = setTimeout(animate, 60);

which is set to 60 msecs by default. decreasing this value will of course increase CPU usage.

Then re-minimise the library and try it on your server.

Thanks Mark,

I’ve changed it from a value of 2 to 4 which doesn’t seem to have made any difference.

Do you think I should go higher than this?

EDIT: I’ve played around with this value & it appears to make no difference to the scroll speed.

Thanks,

I’d like to do this as well as my forecast (now from WXSim via WD) is too long to appear completely before my 30 second reload of the page!

Stuart

Are you sure you are using the updated script on your page?

Unless you change the page it will be using the minimised version of the script. So after editing the full version you need to minimise it to steelseries.min.js

OK, I have been Googling this & for those of you interested in doing this here’s how: -

Open steelseies.js in Notepad and change the line Mark describes above to 3 or 4. I started with 4 but felt the scrolling was a bit fast & jerky so reduced it to 3.

Select all the text and paste it into the ‘Copy & Paste Java Script Code’ window at jscompress.com.

Click the ‘COMPRESS JAVASCRIPT’ button and select all the text in the Output window.

Then open steelseries.min.js in Notepad & replace all the text with the Output text copied from jscompress.com.

Make sure both files are saved in UTF-8 format & replace the same files on your web server.

Your forecast text should then scroll faster. Hope ths helps.

If you are going to be doing much JavaScript minification, then I can recommend the free tool from Microsoft - Ajax Minifier - it is very good and I just create a shortcut to it on my desktop with the parameters I use predefined. Then I can just drag’n’drop a script onto the shortcut and my minified file is created in the same folder as the original.

A good idea, however I need to find a good Linux one for me to use… :wink:

I have modded the code as suggested and it works fine now with the forecast scrolling just as the data reloads.

Stuart

Got a very short forecast today so haven’t been able to test mine properly yet!

What figure did you use, and what’s your download frequency? What’s the URL for your gauges?

Regards,

FIY, I just gave up on the forecast and changed to the current conditions:

"Current Conditions - %weatherreport%" 

I dont have the gauges live on my site yet. I used 4 as the value as my forecast is from WXSim and is longer than the VP one which is not much use IMHO as it is too generic. My page currently refreshes every 30 seconds. $ is a little jerky but it is readable.

Stuart

I have added %zambretti%

That’s great Brian. I shall test that out later.

Regards,

For compressing js, here are YUI compressor in use at http://www.refresh-sf.com/yui/ :smiley:
Also using gzipping gets down the size even further by serving it gzipped or by webserver if compatible to do that (ex. Nginx can gzip all static content), here sizes of my (modified) steelseries.js:

Unminified: 300KB
Minified: 111 KB
Minified + Gzipped: 25 KB

:smiley:

Henkka

Hi Mark,

I have finally got round to updating to the latest version! I would like to speed up the forecast scrolling but notice that there is no steelseries.js file in this package.

Is there still a way to do this?

My latest gauges page can be viewed here: -

http://www.spireweather.co.uk/?page_id=2201

Thanks for all your efforts with this brilliant script, and in advance of your reply,

Simon

The SteelSeries.js file is in the \scripts\src folder.

For use it is minified and combined with tween.min.js into the final file steelseries_tween.min.js
The aim being to reduce the number of separate JS files the page is required to download.

Great, once I’ve amended the steelseries.js file & converted it to steelseries.min.js, how do I combine it with tween.min.js into the steelseries_tween.min.js file?

Thanks.

They are just concatenated, either use an editor, or a command line to combine them into a single file - I put the steelseries first, but I don’t think it matters.