hdultra103 wrote: ↑Tue Nov 21, 2017 7:40 am
I installed the metarWeather block on my home page and set the required settings. When I open my webpage the metarWeather block loads fully open which makes it very long. Is there a way to make it not load fully open? I didn't see a setting for it not to. Thanks.
Hi!
I love the fantastic MetarWeather block (thanks Jachym!) as it shows all my country metars
at once and it is very easy to order and compare their values.
However, I had the same annoying problem of the auto opening of the long metar list, because it forces the viewer to close it, before taking a look at the whole page.
I think that this mandatory auto-open thing, is the reason why, so far, I have not seen any other site using this very useful block.
I solved this problem by quoting 2 lines in metarWeatherBlock.php, that are related to all countries except CA and US.
In your case, since your country is US, quote the 2 lines at the bottom of the script, related to US as shown below.
The only disadvantage of this solution is that you will need to open your state metars by clicking in continent, country and then choose the state.
I could not test this solution because my country is not US, but I hope it will solve your problem, as it solved mine.
You can also take a look at my metarWeather block to check how it is working fine, just with those 2 lines quoted.
http://www.meteocaldas.com/mtp
<?php
if($stationCountry!="us" && $stationCountry!="ca"){
?>
// Quote next 2 lines to avoid auto-open for any country other than CA or US
// $("#metarWeatherData").html('<br><br><br><span class="spinnerMetar">Loading…</span><br><br><br>');
// $("#metarWeatherData").load("homepage/blocks/metarWeather/metarLoad.php?country=<?php echo $stationCountry?>");
<?php
}
else if($stationCountry=="ca"){
?>
// Quote next 2 lines to avoid auto-open if your country is CA
// $("#metarWeatherData").html('<br><br><br><span class="spinnerMetar">Loading…</span><br><br><br>');
// $("#metarWeatherData").load("homepage/blocks/metarWeather/metarLoad.php?country=ca&province=<?php echo strtoupper($defaultProvinceCA)?>");
<?php
}
else if($stationCountry=="us"){
?>
// Quote next 2 lines to avoid auto-open if your country is US
// $("#metarWeatherData").html('<br><br><br><span class="spinnerMetar">Loading…</span><br><br><br>');
// $("#metarWeatherData").load("homepage/blocks/metarWeather/metarLoad.php?country=us&state=<?php echo strtoupper($defaultUSState)?>");
<?php
}
?>
</script>