www.webdeveloper.com
Results 1 to 3 of 3

Thread: For all images >50px width

  1. #1
    Join Date
    May 2011
    Posts
    58

    Exclamation For all images >50px width

    Hello, I have a jQuery code:
    HTML Code:
    $("img").css("border","red solid 1px");
    Witch add border to all images on the page. But how to make border only for images with:
    1) width > 50px
    2) height > 50px

    Thank you.

  2. #2
    Join Date
    Dec 2005
    Posts
    2,984
    Code:
    $('img').each(function() {
     if($(this).width() > 50 && $(this).height() > 50) {
       $(this).css('border','1px solid red');
     }
    });

  3. #3
    Join Date
    May 2011
    Posts
    58
    Thank you very much! - it's amazing

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles