如何使UI(用户界面)响应所有宽度
how to make UI(user interface) responsive for all width?
我在google后做了一个UI,但是我的UI没有响应,当我增加或减少窗口大小时它看起来不太好。
这是我的小提琴http://jsfiddle.net/X8HV9/1/show/我只有两个问题- "向上水平"按钮,它看起来很好,当窗口大小更多(全屏)。当我减小窗口的大小时,它会改变它的位置。但是next和previous按钮看起来不错。
- 当你点击"添加"按钮,它显示弹出屏幕时,屏幕尺寸更多(全屏)。但是当屏幕变小时它会隐藏。
我可以给宽度%吗?
<div data-role="page" id="home">
<div class="main_cont">
<div class="cb"></div>
<section>
<div class="contentbox">
<div class="actionbar">
<a href="#" class="home" id="home_h"></a><a href="#" class="previous" id="previous_h"><i
class="iconprev"></i>Previous</a><a href="#" class="next" id="next_h"><i
class="iconnext"></i>Next</a>
<a style="position: relative;top: 6px;left: 89px;cursor: pointer;" id="oneLevelUp">Up level ^</a>
<div class="cb"></div>
</div>
</div>
</section>
<footer id="firstPageFooter">
<button class="addtestbtn" id="addTestCase" data-theme="a" style="color: #ffffff!important;">Add Test Case</button>
</footer>
<div data-role="popup" id="testCaseId" data-theme="b" data-arrow="b">
<a href="#" data-rel="back" data-role="button" data-theme="a" data-icon="delete" data-iconpos="notext" class="ui-btn-right">Close</a>
<div data-role="fieldcontain">
<label for="testCaseIDValue">Test Case ID:</label>
<input type="text" name="testCaseIDValue" id="testCaseIDValue" value="" class="inputTextTestCase"/>
</div>
<a href="#" data-role="button" id="donePopUp">Done</a>
</div>
</div>
谢谢
是的,你可以使用%缩放宽度,高度,顶部,左距,边距
例如在你的css中:
#next_h{
position:absolute;
width:10%;
}
这将设置宽度为窗口宽度的10%
如果你想在窗口小于一定宽度时缩放,
你可以使用javascript:
if($(window).outerWidth() < 500){
$('#next_h).css({
'position':'absolute',
'width':'80%',
'height':'10px'
});
}
像这样。
你可能也对这篇文章感兴趣
相关文章:
- 使Intro.js工具提示响应
- 使我的视频标头响应
- 如何放置单独的ajax调用,使页面的一部分完全响应,而另一部分仍在加载
- 我正在努力使我的幻灯片响应
- 使无响应的网站响应尽可能容易
- 响应式表设计:使用JQuery使click()展开tr
- 如何使列表生成的html表具有响应性
- 我如何才能使数组中的按钮只对其作出响应'使用javascript的自己的包装器
- 如何在我的“代码块”中使表格 Squarespace 网站响应式
- 如何使 jointjs 论文响应式
- 如何在 D3 中使力布局图.js响应屏幕/浏览器大小
- 使引导标记响应,jquery 事件丢失
- 原型js 如何使定期更新程序隐藏基于ajax响应的类元素
- 如何使 iframe 中的内容响应式
- 使JS响应屏幕宽度
- 使我的JS具有响应性
- 使图像根据高度和宽度做出响应
- Html5 Canvas Javascript使我的网页链接没有响应
- 使滑块响应(jQuery)
- 在保存到本地存储之前,如何修改我得到的 json 响应以使其看起来像这样