zoukankan      html  css  js  c++  java
  • 解决ie10及其以下不兼容input type=file的问题

      

    <!DOCTYPE html>

    <html lang="en">

    <head>

        <meta charset="UTF-8">

        <title>Title</title>

     

    <style type="text/css">

        .file-input-wrapper {

            height: 40px;

            margin: 2px;

            overflow: hidden;

            position: relative;

            width: 118px;

            background-color: #fff;

            cursor: pointer;

        }

        .file-input-wrapper > input[type="file"] {

            font-size: 34px;

            position: absolute;

            top: 0;

            right: 0;

            opacity: 0;

    filter:alpha(opacity=0);

            cursor: pointer;

        }

        .file-input-wrapper > .btn-file-input {

            background-color: #494949;

            border-radius: 0;

            border: 0;

            color: #fff;

            display: inline-block;

            height: 40px;

            margin: 0 0 0 -1px;

            padding-left: 0;

            width: 121px;

            cursor: pointer;

        }

        .file-input-wrapper:hover > .btn-file-input {

        //background-color: #494949;

        }

    </style>

    </head>

    <body>

    <div class="file-input-wrapper">

        <button class="btn-file-input">SELECT FILES</button>

        <input type="file" name="image" id="image" value="" />

    </div>

              

    <script>

        (function($){

            $('input[type="file"]').bind('change',function(){

                $("#img_text").html($('input[type="file"]').val());

            });

        })(jQuery)

    </script>

    </body>

    </html>

  • 相关阅读:
    反转链表——临时变量的妙用
    C++指针学习(2)
    统计英文文本中的词频
    灵活的C++
    编程之美 NIM(1)扩展问题
    深度探索C++对象模型读书笔记(1)
    irrlicht1.7.0(2):基础接口
    关于裁剪空间与投影变换矩阵的推导
    irrlicht1.7.0(1):irrTypes.h
    【转】每天拿两个小时来浪费(文/王路)
  • 原文地址:https://www.cnblogs.com/ln0218/p/5441547.html
Copyright © 2011-2022 走看看