Chris Filippou
Chris Filippou

Reputation: 377

Open Colorbox when you click on the Select box

I want to open a colorbox when the select box is clicked. It doesn't have to open when they select an option, I just want it to open when they click on the down arrow. I can't get it to work!

$("select").click(function () {
     $("#mydiv").colorbox({inline:true, width:"350"});

 });
<select> <option value="1"></option><option value="2"></option></select>
<div style="display:none;"><div id="mydiv"> content here </div></div>

Any ideas why this will not work??

Upvotes: 0

Views: 820

Answers (1)

adeneo
adeneo

Reputation: 318222

You need to pass it an element as well:

$("select").click(function () {
     $.colorbox({inline:true, href:"#mydiv", width:"350"});
});

FIDDLE

Upvotes: 3

Related Questions