Popups behaves weird when previewing

I have a couple of popups throughout my site. They all work fine but when editing a page and then using the "Preview" option it opens the page and triggers ALL popups. So I have to close them one-by-one to see the page.