Jimmy
Jimmy

Reputation: 12487

Open jqueryUI modal with a link

I cant figure this out for the life of me. I want to open a modal (dialoge) box with jqueryUI. All the examples use a button to do it.

Can someone post an example which uses a simple link to open a basic jqueryui diagloge box

Upvotes: 1

Views: 2250

Answers (5)

Kenrick Chien
Kenrick Chien

Reputation: 1046

Try this sample that I made on jsfiddle: http://jsfiddle.net/qWNa9/

Upvotes: 3

ShdwBxr
ShdwBxr

Reputation: 31

If you want to bind the dialog opening event to someone clicking on the link, you could use something like this:

$("#linkid").on("click", function() {
    $("#dialogId").dialog();
});

linkid == the ID on your tag, and dialogId == the ID on the containing element of what you want displayed in your dialog

Upvotes: 1

Madurika Welivita
Madurika Welivita

Reputation: 900

Following will help you, adjust according to your scenario

http://www.ericmmartin.com/projects/simplemodal-demos/

Upvotes: 0

Josh
Josh

Reputation: 815

Try using

<a href="javascript:void(0)">

Then bind to the .click() event

Upvotes: 0

Dave Hogan
Dave Hogan

Reputation: 3221

just use the dialog("open") function.

$(".alink").dialog("open");

Upvotes: 0

Related Questions