响应菜单与调整大小 [英] Responsive menu with resizing
本文介绍了响应菜单与调整大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要响应按钮这样:
我们在菜单上有15个按钮。当浏览器调整大小时,一些按钮添加到< select>
像这样:
I need to responsive button like this:
we have 15 buttons on a menu. When the browser is resizing, some buttons add to <select>
like this:
我有 this jsFiddle 来演示问题:
推荐答案
窗口已调整大小。我不知道这是否可以用CSS。你应该更喜欢这个..
This is too much manipulation when the window is resized. I don't know if this can be done with CSS. You should prefer that..
但这里是一个有用但脏的 fiddle with Javascript / jQuery 。
您应该聆听 resize
事件。
But here is a working but dirty fiddle with Javascript/jQuery.
You should listen to the resize
event.
$(document).ready(function (event) {
buildMenu();
$(window).resize(function (event) {
buildMenu();
});
});
这篇关于响应菜单与调整大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文