【问题标题】:mobile responsive form not working移动响应表单不起作用
【发布时间】:2016-03-15 03:26:15
【问题描述】:

在我的移动响应网站注册页面上,注册表从 PC 上的原始位置移动到手机/移动设备上的不同位置。重新定位的表单不起作用(我无法输入值或文本)

(在 iphone 5 和其他手机上运行良好,Iphone 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>

【问题讨论】:

    标签: javascript jquery html css responsive-design


    【解决方案1】:

    我认为您只是想移动表单。所以只要把它和这段代码放在一起。

    $('#side-content').insertAfter('#mobilePos');

    Css 函数仅用于使用 jquery 设置元素样式。

    CMIIW.

    【讨论】:

    • 请你更好地解释一下,或者..把我应该用什么替换当前代码..我可以复制粘贴
    【解决方案2】:

    使用此代码:

    $(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');
        }
      });
    });
    

    【讨论】:

    • 谢谢,但与问题中的第一个代码相同
    【解决方案3】:

    使用 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
     }
    

    移动屏幕也是如此,您想要任何其他屏幕,例如智能电视等 ..

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-05-18
    • 1970-01-01
    • 1970-01-01
    • 2018-04-01
    • 1970-01-01
    • 2015-07-02
    • 1970-01-01
    • 2021-09-08
    相关资源
    最近更新 更多