If it's what I'm thinking of, it seems to be called a "slide toggle." (Most people would just call it "the little thingy that you slide to adjust the straps of a hat.")
Unfortunately, "toggle" and "slide toggle" also seem to be computer programming terms. If you do a google search for "slide toggle hat," you'll see what I'm thinking of.