1

We are using msDropDown plugin to theme drop down control in the page. The plugin was downloaded from www.marghoobsuleman.com

We don't have to apply any function in document.ready or anywhere just adding below reference does it's job.

<script src="../Scripts/jquery.dd.js" type="text/javascript"></script>

But it it applying the style to list boxes as well. here is the script source:

http://www.keendevelopers.in/jquery.dd.js

Is there any way to avoid them applying on List boxes? To avoid this we tried giving css class "elelistbox" to all Listboxes.

 <asp:ListBox ID="ListITProgramming" runat="server" CssClass="listViewStyle elelistbox"
                                                        SelectionMode="Multiple" OnDataBound="ListITProgramming_DataBound"></asp:ListBox>

Can anyone help?

4

2 回答 2

0

我修好了它。我添加了一个条件来检查 jquery.dd.js 文件中的“elelistbox”类。

$.fn.extend({
        msDropDown: function(settings)
        {
            return this.each(function()
            {
                if (!$(this).hasClass('elelistbox')){
                    if (!$(this).data('dd')){
                        var mydropdown = new dd(this, settings);
                        $(this).data('dd', mydropdown);
                    };
                };
            });
        }
});
于 2013-12-24T13:53:09.100 回答
0

我已经尝试过您的要求,根据以下代码将有助于解决您的问题。

$(document).ready(function(){

           setTimeout(function () {
               $("select[class!='elelistbox']").each(function (i) {
                    //alert($(this).attr('class'));
                    // do your stuff
                    $(this).msDropDown();
               })
           }, 500);

       });
于 2013-12-06T10:34:11.527 回答