开发者

Changing skin on jquery msdropdown plugin

开发者 https://www.devze.com 2023-04-12 03:15 出处:网络
I\'m using the Jquery plugin msdropdown http://www.marghoobsuleman.com/jquery-image-dropdown but am confused on how to change the skin. By default it uses the dd skin in the msdropdown/dd.css file. Th

I'm using the Jquery plugin msdropdown http://www.marghoobsuleman.com/jquery-image-dropdown but am confused on how to change the skin. By default it uses the dd skin in the msdropdown/dd.css file. There is also a second skin called dd2, which is more desirable for my site.

<select style="width:150px" name="webmenu" id="webmenu" onchange= "openprompt()">
        <option value="selectvalue">Select...</option>
    <option value="augustanacollege" title="icons/augustanacollege.gif">Augustana College </option>
    <option value="aurorauniversity " title="icons/aurorauniversity.gif">Aurora University</option>
  </select>

<script language="javascript">
$(document).ready(function(e) {
try {
$("body select").msDropDown();
} catch(e) {
alert(e.message);
}
});
</script>

<script language="javascript">
    $(document).ready(functio开发者_如何学Gon(e) {
        try {
        $("#webmenu").msDropDown();
    }
    });
</script>

It's saying to add the following code to change the skin:

<code>$("#comboboxid").msDropDown({mainCSS:'dd2'}); //dd2 is your main CSS

So would #comboboxid equal my dropdown box id of #webmenu? Also, is mainCSS just my dd.css file? If so, do I need to specify the location like so: msdropdown/dd.css?


Using code you mentioned you can specify css class for the dropdown you've created:

$("#webmenu").msDropDown({mainCSS:'dd2'});

In your dd.css file you can find default styles. Copy them, modify like you want and call main css class something different than dd and assign it to property in sample.

Also you can leave how it is and just update styles in dd.css to match you requirements.

Important note:

Please don't change "display, float and overflow" properties.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号