How to add Chosen Plugin to dynamically created / cloned CSS div?

后端 未结 4 780
傲寒
傲寒 2020-12-04 02:42

The Chosen Plugin for jQuery (found here: http://harvesthq.github.com/chosen/ ) adds extra functionality to select HTML elements. I can add the functionality to the initial

4条回答
  •  抹茶落季
    2020-12-04 02:56

    The work around I came up with was similar to Abhinav's. I removed the Chosen generated code. Stripped the "chzn-done" class from the selectbox. Turned off display:none on the selectbox and then reapplied chose to the selectbox

    $j("#masterCats_chzn").remove();
    $j("#masterCats").css({display: "inline-block"}).removeClass("chzn-done").addClass("chsn");
    $j(".chsn").chosen();
    

提交回复
热议问题