Code Monkey home page Code Monkey logo

moblie-for-pic's Introduction

moblie-for-pic

Suitable for all size of the pictures in the mobile phone, but does not support real-time change the size of the picture

##No.1 simulate placeholders

  1. the placeholders' color is darkGrey in input box by default.
  2. the placeholders' color is lightGrey when in a state of focus.
  3. After entering words for the input box, the placeholder is emptied.

moblie-for-pic's People

Contributors

lienmac avatar

Watchers

James Cloos avatar  avatar

moblie-for-pic's Issues

code

<title>无标题文档</title> <style> *{ margin:0; padding:0; border:0; font-size:12px; line-height:1.6; font-family:"微软雅黑"; } p{ position:relative; margin-bottom:10px; } .box_txt{ width:200px; height:30px; border:1px solid #ddd; line-height:30px; text-indent:5px; } label{ position:absolute; left:5px; top:5px; color:#ccc; cursor:text; } .color_999{ color:#999; } </style> <script language="javascript" type="text/javascript" src="js/jquery.js"></script> <script language="javascript"> jQuery.fn.extend({ propertychange: function(fn) { if (!+ [1, ] != true) { $(this).get(0).addEventListener("input", fn, false); } $(this).bind("propertychange", fn); return this; } }); jQuery(function($){ $('.box_txt').each(function() { if($(this).val()){ $(this).siblings('label').hide(); }else{ $('.box_txt,label').click(function(){ $(this).parent().find('label').addClass('color_999'); $(this).parent().find('.box_txt').focus(); $(this).parent().siblings('p').find('label').removeClass('color_999'); }); } $(this).propertychange(function(){ if($(this).val()){ $(this).siblings('label').hide(); }else{ $(this).siblings('label').show().addClass('color_999'); } }); $(this).blur(function(){ $(this).siblings('label').removeClass('color_999'); }); }); }); // if('placeholder' in document.createElement('input')){ // alert('got'); // }else{ // alert('aaa'); // } </script>

请输入职位名、公司名等关键字

请输入职位名、公司名等关键字

请输入职位名、公司名等关键字

baidu

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.