简体   繁体   English

如何在使用selectBoxIt更改为横向模式时刷新所有选择字段?

[英]How to refresh all select fields on changing to landscape mode with selectBoxIt?

i need help. 我需要帮助。 Was working on it but i couldn't solve the issue! 正在努力,但我无法解决问题!

The documentation says it's possible to rebuild all sleect fields. 该文档说,可以重建所有sleect字段。 http://gregfranko.com/jquery.selectBoxIt.js/#MethodAPI http://gregfranko.com/jquery.selectBoxIt.js/#MethodAPI

I need a solution to rebuild all select fields on changing to landscape to put the width back to 100% and vise versa. 我需要一个解决方案来在更改为横向时重建所有选择字段,以将宽度恢复为100%,反之亦然。 That is what Igot so far! 到目前为止,这就是我所了解的!

var selectBox = $("select").selectBoxIt().data("selectBoxIt");

window.onresize = function() {
    $("select").selectBoxIt().refresh();
}

请尝试以下语句:

$('select').data('selectBox-selectBoxIt').refresh();

如果您只是想更改选择正文的CSS宽度,则应使用CSS3媒体查询。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM