Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- First call this before the </body> -->
- <!--[if IE]>
- <script src="js/placeholder.iesupport.js"></script>
- <![endif]-->
- <!--[if IE]>
- <script src="http://jamesallardice.github.io/Placeholders.js/assets/js/placeholders.min.js"></script>
- <![endif]-->
- <!-- This for placeholder input IE support js save this js name like placeholder.iesupport.js and put into your js file -->
- // placeholder IE support js
- jQuery(function() {
- jQuery.support.placeholder = false;
- webkit_type = document.createElement('input');
- if('placeholder' in webkit_type) jQuery.support.placeholder = true;});
- $(function() {
- if(!$.support.placeholder) {
- var active = document.activeElement;
- $(':text, textarea, :password').focus(function () {
- if (($(this).attr('placeholder')) && ($(this).attr('placeholder').length > 0) && ($(this).attr('placeholder') != '') && $(this).val() == $(this).attr('placeholder')) {
- $(this).val('').removeClass('hasPlaceholder');
- }
- }).blur(function () {
- if (($(this).attr('placeholder')) && ($(this).attr('placeholder').length > 0) && ($(this).attr('placeholder') != '') && ($(this).val() == '' || $(this).val() == $(this).attr('placeholder'))) {
- $(this).val($(this).attr('placeholder')).addClass('hasPlaceholder');
- }
- });
- $(':text, textarea, :password').blur();
- $(active).focus();
- $('form').submit(function () {
- $(this).find('.hasPlaceholder').each(function() { $(this).val(''); });
- });
- }
- });
- <!-- This for placeholder input IE support css save this css name like specific-browser.css and put into your css file-->
- /*
- Firefox
- */
- @-moz-document url-prefix() {
- .right_content{width:760px;float:left;text-align:left;display:inline;}
- :-moz-placeholder { color: rgba(255,0,0,0.4) !important; }
- /*start to write your specific browser css here*/
- }
- /*
- Chrome + Safari + Opera
- */
- @media screen and (-webkit-min-device-pixel-ratio:0) {
- .right_content{width:760px;float:left;text-align:left;display:inline;}
- ::-webkit-input-placeholder { color: rgba(900,0,0,0.900) !important; }
- /*start to write your specific browser css here*/
- }
- /*
- Internet Explorer 10
- */
- @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
- .right_content{width:760px;float:left;text-align:left;display:inline;}
- input:-ms-input-placeholder{color: rgba(255,0,0,0.75);}
- /*start to write your specific browser css here*/
- }
- /*textarea color not support for IE ALL*/
- /*
- Internet Explorer 9-10
- */
- @media screen and (min-width:0\0) {
- .right_content{width:760px;float:left;text-align:left;display:inline;}
- input.hasPlaceholder{color:red}
- }
- /*
- Internet Explorer 8
- */
- @media \0screen\,screen\9 {
- .right_content{width:760px;float:left;text-align:left;display:inline;}
- input.hasPlaceholder{color:red}
- }
- /*
- Internet Explorer 7
- */
- @media screen\9 {
- .right_content{width:760px;float:left;text-align:left;display:inline;}
- input.hasPlaceholder{color:red}
- }
- /*
- ONLY FOR OPERA
- */
- @media all and (-webkit-min-device-pixel-ratio:10000), not all and (-webkit-min-device-pixel-ratio:0) {
- input.hasPlaceholder{color:red}
- #my-id { clear:right; }
- }
- /*
- only for safari
- */
- @media screen and (-webkit-min-device-pixel-ratio:0) {
- input.hasPlaceholder{color:red}
- #my-id { height: 100%; }
- }
- <!--placeholdercolor textarea text color IE support css put this css into your style.css -->
- .hasPlaceholder{color:red}
- <!-- if you want to do automatically Allow Blocked Content in IE then use the bellow code before <html> -->
- <!-- saved from url=(0014)about:internet -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement