Is it milky substance, or cottony substance? If it's milky, then they are creating excess slime coating to ward off something in the tank they don't like.. if it's fuzzy white cottony then it's fungus.. but normally fungus spreads, not disappear..
If it's just slimey goo that disappears then all you need to really do is a few water changes.. I would do a 50% water change every other day for the next week- so about 3 - 4 total 50% water changes. That will help clear out whatever it is in the tank that your fish are having bad reactions to. Are you siphoning it out regularly? Is the tank planted with live plants?
If the white stuff is fluffy like cotton and you can see "hairs" then it's fungus and you would need to do medication- QTing them all..
Normally you will also see them lethargic, not eating, clamped fins, pale colors.
Lower temperature below 76* F and treat with AQ. Salt at 1 tsp/gal. Increase water changes to 100% daily. Replace accurate amount of salt following water changes. Never continue salt treatments for more than 10 days. If Conservative treatment is ineffective after 10 days or you see the fungus spread rapidly during the course of conservative treatment, move to medication. Add “Fungus Eliminator” by Jungle, API Erythromycin, API Fungus Cure, API Triple Sulfa, OR Mardel’s Maracyn II. Change water every day and add a new dose of the same medication. Continue until all fungus has disappeared.
Just make sure it's fungus before you put them through that.. is there a way to get a picture of it?
If it's the fungal fin rot, the AQ salt and fungus meds will work for it as well.