$(window).load(function(){
$('.tempf').hide();
});
$('.tempf,.tempc').click(function(){
$('.tempf,.tempc').toggle();
});
background-color: #722872 !important;
height: 80px;
border-color: #592059;
}
#banner {
background-color: #722872 !important;
height: 80px;
border-color: #592059;
}
:star2: 1267 | @wearenotgroot |http://www.freecodecamp.com/wearenotgroot
anyone know why when you click the "online" button and then the "all" button on my twitch viewer, the "offline" shows up for a split second before the "online" section does? ideally, i'd like a smooth transition without the offline users coming up briefly before the online...
@bethqiang - I don't know if this would help, I was experimenting with your project but had to reload and lost my changes. Any time your use a jQuery selector like $('#online')
, it will search the DOM to find the element or elements that it corresponds to. I don't know enough detail about how jquery works to know if it does multi-threading, searching for both of those at the same time and perhaps sometime returning the "offline" first? I tried making a class "allUsers" and using that selector.
The other thing I was trying, when I had to reload and lost it, was to cache the results of the jquery selector and the use that - var allUsers = $("#online #offline");
I think would cache the results, not sure about the order, though? I'll try it and see, perhaps fork it so I can save it in case I need to reload.
function makeFriendlyDates(arr) {
var arr0 =arr.pop();
arr0= arr0.split(/-/);
for(i=0;i<arr0.length;i++){
switch (arr0[1]) {
case 01:
arr0[1] = "Janurary";
break;
case 02:
arr0[1] = "February";
break;
case 03:
arr0[1] = "March";
break;
}}
return arr0;
}
makeFriendlyDates(['2016-01-01', '2016-02-04']);
Hello FIrends Im back!.. In this problem Ive seperated the date format and am gonna try using switch statements to convert the numbers to words.. It says "Octal literals are not allowed in strict mode." When i do this though... Is this workable or have I made a mistake somewhere??