Показать сообщение отдельно
  #5 (permalink)  
Старый 02.07.2016, 20:37
Аватар для рони
Профессор
Отправить личное сообщение для рони Посмотреть профиль Найти все сообщения от рони
 
Регистрация: 27.05.2010
Сообщений: 33,070

joker95,
попробуйте так
<!DOCTYPE html>

<html>
<head>
  <title>Untitled</title>
  <meta charset="utf-8">
  <style type="text/css">
  .photo_numb:after{
    content: "big"
  }

  </style>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>

  <script>
 $(function(){
 $(".ob_img").each(function(indx, div){
 var img = $("img",div), width = img.width();
 width && width > 100 ? $(div).append('<div class="photo_numb">this is </div>') :
 img.on("load", function() {
    img.width() > 100 && $(div).append('<div class="photo_numb">this is </div>');
});
});
})
  </script>
</head>

<body>
<div class="ob_img">
  <img src="http://i.i.ua/photo/images/pic/6/4/1008546_75741f3e.jpg"  alt="">
</div>
<div class="ob_img">
  <img src="http://pda.maybe.ru/p/177/176879/t17638688.jpg"  alt="">
</div>
<div class="ob_img">
  <img src="http://i.i.ua/photo/images/pic/6/4/1008546_75741f3e.jpg"  alt="">
</div>
<div class="ob_img">
  <img src="http://pda.maybe.ru/p/177/176879/t17638688.jpg"  alt="">
</div>
</body>
</html>
Ответить с цитированием