Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
选择搜索框后,它应该向各个方向展开以占据移动设备中页面的剩余顶行。我想使用 HTML5,CSS3 和简单的 Javascript(无库)。如何实施?
我明白了。使用javascript向上移动搜索框。 我在下面的函数中将文本框作为 obj 传递..它有效!!!
function findPos(obj) { var curtop = 0; if (obj.offsetParent) { do { curtop += obj.offsetTop; } while (obj = obj.offsetParent); curtop=curtop-5; return [curtop]; } }