Can't change dk_toggle width from dropkick plugin

喜你入骨 提交于 2019-12-25 04:17:39

问题


I'm using dropkick jQuery plugin

I know, that dk_toggle has default width: 220px:

      <a class="dk_toggle" style="width: 220px; ">(from Google console)

My html in my view:

     <select name="country" class="default" tabindex="2">
          <option value="EN">English</option>
          <option value="IS">Israeli</option>
          <option value="UA">Ukrainian</option>
        </select>

But I want to change it in my css file:

 .dk_toggle {
 height: 15px;
 width: 245px;
}

It isn't changing. So HOW I should change it ?


回答1:


In your javascript file add

$(document).ready(function() {
    $('.dk_toggle').css('width','220px');
})



回答2:


First, set an ID to your select:

 <select id="my_select" name="country" class="default" tabindex="2">
      <option value="EN">English</option>
      <option value="IS">Israeli</option>
      <option value="UA">Ukrainian</option>
 </select>

Then set a CSS for this ID:

#my_select{
  width: 200px;
}

I just tested it, and probably a cleaner way to do it.



来源:https://stackoverflow.com/questions/11357289/cant-change-dk-toggle-width-from-dropkick-plugin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!