2

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?

Dhaval Panchal
  • 612
  • 4
  • 12
  • 32

2 Answers2

0

I have tried your requirement and as per that following code will help to solve your issue.

$(document).ready(function(){

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

       });
Bhavesh Kachhadiya
  • 3,902
  • 3
  • 15
  • 20
0

I fixed it. I have added one condition to check the "elelistbox" class in jquery.dd.js file.

$.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);
                    };
                };
            });
        }
});
Dhaval Panchal
  • 612
  • 4
  • 12
  • 32