Scarface
Scarface

Reputation: 3913

Jquery only keep one dialog open at once

Hey guys just a quick question, I am posting mp3s in dialog boxes each associated with a unique link and I would like it so that only one stay open at once, so that if you have one open, and try to open another one, the previous one closes. Is this possible?

Upvotes: 0

Views: 238

Answers (1)

Diodeus - James MacFarlane
Diodeus - James MacFarlane

Reputation: 114367

What you can do is have a single main dialog element. Copy the contents of the requested dialog into the main dialog, position and show it. Every new call simply hides, replaces the contents and shows the same box.

Make a function that passes a reference to the element where the content resides. Copy, position, fade-in, voila!

Upvotes: 1

Related Questions