Перейти к содержимому
Fozzy

Fozzy

На сайте с 13 сентября 2011 г.

Пользователь пока ничего не рассказал о себе.

рейтинг

100

постов

8

комменты

0

подписчик

1

подписок

0

В IE и opera optgroup и option не скрываются стандартным jquery hide или css display:none

//В IE и opera optgroup и option не скрываются стандартным jquery hide или css display:none

  1. $.fn.hideOptgroup = function() {
  2. this.each(function() {
  3. if ($(this).is('optgroup') && (!$(this).parent().is('span'))) {
  4. $(this).wrap('<span>').hide();
  5. }
  6. });
  7. };
  8. $.fn.showOptgroup = function() {
  9. this.each(function() {
  10. if (this.nodeName.toLowerCase() === 'optgroup') {
  11. var p = $(this).parent(),
  12. o = this;
  13. $(o).show();
  14. $(p).replaceWith(o);
  15. } else {
  16. var opt = $('optgroup', $(this));
  17. $(this).replaceWith(opt);
  18. opt.show();
  19. }
  20. });
  21. };

http://work.arounds.org/issue/96/option-elements-do-not-hide-in-IE/

0
1
445

Пример HTML и CSS: закругление углов с использованием боковых блоков

 
 .tab
{
cursor:default;
font-size:18pt;
margin-left:40px;
height: 46px;
line-height:46px;
font-family:Times New Roman;
position: relative;
text-align: center;
background:url('images/trade-tab-select-center.jpg') repeat-x;
padding: 0px 40px;
color:#a2a3a6;
display:inline-block;
}
.left, .right{
width: 7px;
height: 46px;
font-size: 0;
overflow: hidden;
position: absolute;
top: 0;
}
.left{
background: url('images/trade-tab-select-left.jpg') no-repeat;
left: 0;
}
.right{
background: url('images/trade-tab-select-right.jpg') no-repeat;
right: 0; /* нулевое смещение справа */
margin-left: 100%; /* для IE6 */
left: -7px; /* для IE6 */
}

</style> <body> <div class="tab"> Главная <span class="left"></span> <span class="right"></span> </div> </body>
0
0
412

Yandex text input с тенью

yandex text input с тенью css&lt;style&gt; .b-form-input{display:block} .b-form-input__box{display:block;padding-left:.3em;border:1px solid} .b-form-input__box{height:26px;} .b-form-input__box{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;border-color:#a3a3a3 #c6c6c6 #e5e5e5;background:#fff;-webkit-box-shadow:inset 0 1px 1px #cfcfcf;-moz-box-shadow:inset 0 1px 1px #cfcfcf;box-shadow:inset 0 1px 1px #cfcfcf} .b-form-input__input{font:100% Arial,sans-serif;width:100%;height:100%;margin:0;border:0} .b-form-input__input{font-size:16px} .b-form-input__input{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;outline:0;background:none} &lt;/style&gt; HTML&lt;span class="b-form-input"&gt; &lt;span class="b-form-input__box"&gt; &lt;input…

0
1
402

Условные комментарии для IE

Условные комментарии для IE Будут работать только в Internet Explorer не ниже 5-ой версии. &lt;!--[if IE]&gt; Инструкции для Internet Explorer &lt;![endif]--&gt; &lt;!--[if IE 5]&gt; Инструкции для IE 5 &lt;![endif]--&gt; &lt;!--[if IE 5.0]&gt; Инструкции для IE 5.0 &lt;![endif]--&gt; &lt;!--[if IE 5.5]&gt; Инструкции для IE 5.5 &lt;![endif]--&gt; &lt;!--[if IE 6]&gt; Инструкции для IE 6 &lt;![endif]--&gt; &lt;!--[if IE 7]&gt; Инструкции для IE 7 &lt;![endif]--&gt; В условных комментариях можно использовать операторы, с помощью которых можно задать более комплексное условие. В таблице ниже приведены все операторы. Оператор Описание lt меньше чем lte меньше или равно gt больше чем gte больше или равно И несколько примеров: &lt;!--[if ! IE 5]&gt; Инструкции для IE 5.5, 6 или 7 &lt;![endif]-…

0
0
279

INPUT который принимает только цифры.

 

Jquery, JavaScript

 
  1. $(document).ready(function () {
  2. //Привязываем проверку к текстовым полям с классом .number
  3. $('input.number').keypress(function (e) {
  4. //Если символ - не цифра, выводится сообщение об ошибке.
  5. if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) {
  6. //Вывод сообщения об ошибке
  7. $("#error_message").html("Только цифры!").show().fadeOut("slow");
  8. //Устанавливаем координаты ошибки
  9. $("#error_message").offset({ top: $(this).offset().top, left: $(this).offset().left });
  10. e.preventDefault();
  11. }
  12. });
  13. });
 

HTML

  1. <div id="error_message" style="left: 50%; margin-left: -50px; display:none; position: absolute; width:100px; text-align:center; padding:20px; background-color:Yellow; color:Red;"></div>
0
0
445