移动响应表单不起作用
mobile responsive form not working
在我的移动响应式网站注册页面上,注册表从其在PC上的原始位置移动到电话/移动设备上的不同位置。重新定位的表单不起作用(我无法输入值或文本)
(在iPhone 5和其他手机上工作正常,苹果手机6上的chrome除外)
<script type="text/javascript">
$(document).ready(function(){
if ($(window).width() <= 767){
$('#side-content').insertAfter('#mobilePos').css;
} else {
$('#side-content').insertAfter('#desktopPos').css;
}
});
$(window).resize(function(){
if ($(window).width() <= 767){
$('#side-content').insertAfter('#mobilePos').css;
} else {
$('#side-content').insertAfter('#desktopPos').css;
}
});
</script>
我认为您只想移动表单。所以只需把它和这个代码放在一起。
$('#side-content').insertAfter('#mobilePos');
css 函数仅用于使用 jquery 设置元素样式。
中医网.
使用以下代码:
$(document).ready(function(){
$(window).load(function(){
if ($(window).width() <= 767){
$('#side-content').insertAfter('#mobilePos');
} else {
$('#side-content').insertAfter('#desktopPos');
}
});
$(window).resize(function(){
if ($(window).width() <= 767){
$('#side-content').insertAfter('#mobilePos');
} else {
$('#side-content').insertAfter('#desktopPos');
}
});
});
使用 css 媒体查询
@media (min-width: 768px) and (max-width: 1100px) {
User Css Code For min - desktop Screen resolution
}
@media (min-width: 480px) and (max-width: 767px) {
User Css Code For Tab Screen resolution
}
移动屏幕也是如此,你想要任何其他屏幕,如智能电视等等。
相关文章:
- 动态Javascript表单不起作用
- 加载后的页面与ajax表单提交不起作用
- Jquery的表单验证不起作用
- Ajax在JQuery表单插件中不起作用
- 带有select的jquery提交表单不起作用
- 编辑不起作用的表单的特定行和重置特定字段
- jQuery日期选择器在Codeigniter和Bootsrap模式表单中不起作用
- 表单中的提交按钮在 PHP 打印中不起作用
- HTML表单在IE中不起作用
- 下拉 jquery 方法发布表单不起作用
- 表单提交前客户端地理编码的实现;不起作用
- JavaScript onChange 事件侦听器对输入表单不起作用
- 谷歌浏览器模式正则表达式在使用setCustomValidity动态创建表单时不起作用
- 表单验证在 HTML 中工作的 Visualforce 中不起作用
- 表单验证不起作用,并阻止表单提交
- JS表单验证功能不起作用
- 刷新<表单>送审不起作用
- onClick 事件在表单标记中不起作用
- 返回false不起作用,单击h:commandButton将触发操作
- 动画不起作用后单击JQuery