function switcher (one, two) {
if (win.width() < 900) {
one.insertAfter(two);
} else {
one.insertBefore(two);
}
}
var frst = div.find('.first');
var scnd = div.find('.second');
我的问题是:这是有效的:
win.on('resize', function () {
switcher(frst, scnd);
});
这不起作用,为什么?
win.on('resize', switcher(frst, scnd));
谢谢!