Simpleweather.js interfering with Concrete 5.7 interface
PermalinkI'm hoping someone might be able to shed some light on a conflict I'm having between simpleweather.js and Concrete5 5.7 interface.
When I add the required
$(document).ready(function() { $.simpleWeather({ location: 'Traralgon, Australia', unit: 'c', speed: 'kph', success: function(weather) { html = '<h2>'+weather.city+', '+weather.region+'</h2>'; html += '<div style='width:50%;float:right;'><i class='current icon-'+weather.forecast[0].code+''></i></div><p class='current'>'+weather.temp+'<sub>°'+weather.units.temp+'</sub></p>'; html += '<div class='clearfix'></div><ul class='sidebar-list'>'; for(var i=0;i<weather.forecast.length;i++) { html += '<li><span style='font-weight:700;'>'+weather.forecast[i].day+'</span><span><i class='icon-'+weather.forecast[i].high+''></i></span><span>'+weather.forecast[i].low+'<sub>°'+weather.units.temp+'</sub></span><span>'+weather.forecast[i].high+'<sub>°'+weather.units.temp+'</sub></span></li>'; } html += '</ul>'; $('#weather-sidebar').html(html); },
Into my settings.js file, all of a sudden Concrete5's (5.7) edit menu stops sliding out the selected panels such as 'publish' and 'dashboard'. If I click on the dashboard button, it takes me directly to index.php/dashboard which is somewhat acceptable but when I click on any of the three left side buttons, they simply show an animated blue circle like they are loading.
Any help on resolving this conflict would be greatly appreciated.
No errors in the console unfortunately.
I can seem to see to any degree symbols in the snippet so I am going to guess that it is browser/site related.
Download the js file fromhttps://cdnjs.cloudflare.com/ajax/libs/jquery.simpleWeather/3.0.2/jq...
Just go to your active theme folder and copy paste the file jquery.simpleWeather.js file . Now go to the footer.php of your active theme.
and paste the code written below
<div id="weather"></div>
<script src="<?php echo $this->getThemePath(); ?>/js/jquery.simpleWeather.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$.simpleWeather({
location: 'Austin, TX',
woeid: '',
unit: 'f',
success: function(weather) {
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>';
html += '<li>'+weather.wind.direction+' '+weather.wind.speed+' '+weather.units.speed+'</li></ul>';
$("#weather").html(html);
},
error: function(error) {
$("#weather").html('<p>'+error+'</p>');
}
});
});
</script>
I could hide the script when in edit mode however I am worried it may be the sign of something else.
That would be great... I'll put together a sample within a day or so as it's currently on an XAMPP install. I will PM the details to you.
Thanks for taking a look into it. Much appreciated.
Do you have any errors in your browser console?