:star2: 1266 | @wearenotgroot |http://www.freecodecamp.com/wearenotgroot
:warning: 2irina2 already gave marhyorh points
$(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.