首页 > 其他 > 详细

响应式布局(三更)

时间:2015-12-23 00:26:39      阅读:166      评论:0      收藏:0      [点我收藏+]

今天所做的一些题和遇到的问题。

 

一:怎样最便捷的书写流式布局的开头

代码如下:

<div id="container">
    <div class="main">
        <div class="head"><img src="image/tmp/banner.jpg" /></div>
    </div>
</div>


#container{
    height:1000px;
    width:100%;
}
#container .main{
    max-width:12.8rem;
    min-width:6rem;
    height:auto;
    margin:0 auto;
}
#container .main .head{
    /*height:auto;*/
    width:100%;
}
#container .main .head img{
    height:100%;
    width:100%;
}

  生成的原网页如下:

技术分享

上面是初始化的图片,下面是网页随着屏幕大改变而改变。

技术分享

 

二:应用JS加上响应式布局来完成input框按钮来改变字母数字的转换

代码如下:

  <input  class="txt-input txt-password " type="password" placeholder="请输入qq号码" name="password" style="display: inline;">
 <input  class="txt-input txt-password" type="password" placeholder="验证码" name="password" style="display: inline;">

<script>

    $(function() {
        $(".input-close").hide();
        displayPwd();
        displayClearBtn();
        setTimeout(displayClearBtn, 200 ); //延迟显示,应对浏览器记住密码
    });


    //显隐密码切换
    function displayPwd(){
        $(".tp-btn").toggle(
                function(){
                    $(this).addClass("btn-on");
                    var textInput = $(this).siblings(".plaintext");
                    var pwdInput = $(this).siblings(".ciphertext");
                    var pwdInput1 = $(this).siblings(".ciphertext1");
                    pwdInput.hide();
                    pwdInput1.hide();
                    textInput.val(pwdInput.val()).show().focusEnd();
                    textInput.val(pwdInput1.val()).show().focusEnd();
                },
                function(){
                    $(this).removeClass("btn-on");
                    var textInput = $(this).siblings(".plaintext");
                    var pwdInput = $(this).siblings(".ciphertext");
                    var pwdInput1 = $(this).siblings(".ciphertext1");
                    pwdInput.hide();
                    pwdInput1.hide();
                    textInput.val(pwdInput.val()).show().focusEnd();
                    textInput.val(pwdInput1.val()).show().focusEnd();
                }
        );
    }

                

  生成的网页如下:在没有改变字母数字转换之前

技术分享

 

  改变字母数字的转换:

技术分享

 

 

今天在做这个js的时候做了很久,可能好久都没有用到js来完成网页了,稍微有点疏漏,

明天的博客就写关于js的问题,就相当于回顾以前所学的知识。

响应式布局(三更)

原文:http://www.cnblogs.com/yzhong/p/5068531.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!