Jump to content

nataly

Newbie
  • Posts

    1
  • Joined

  • Last visited

nataly's Achievements

Explorer

Explorer (1/14)

0

Reputation

  1. Надо чтобы загруженная картинка анализировалась вертикальная она или горизонтальная и в зависимости от этого присваивается width или heigth, тк задание одного параметра даст пропорциональное уменьшение. В итоге она ложится в квадрат и края обрезаются. вот код. [ code ] <div style="overflow:hidden; width:200px; height:200px;"> <script type="text/javascript"> function razmer(x) { var y = parseInt(x); if (y >= 0) {return "height"}; if (y < 0) {return "width"}; } </script> <img src="$IMG_SMALL_URL1$" class="newsPictures" border=0 onLoad="(razmer(width-height))='200px'" > </a> </div> [ /code ] $IMG_SMALL_URL1$ - путь к картинке. применение id не подходит, тк последовательно грузится много картинок. никак не работает ((Sos))
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy