问题
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