Search Results

Search found 2 results on 1 pages for 'nicknick'.

Page 1/1 | 1 

  • JavaScript/HTML: How do I display an IMG with a set dimension and if the image is wider or taller th

    - by NickNick
    I have a bunch of images that are guaranteed to have: minimum width = 200px maximum width = 250px minimum height = 150px maximum height = 175px What I want to do is display a consist 200px by 150px rectangle of the image while maintaining scale (no stretching or shrinking). Which means, I might have some overflow. How can I display the image so that it keeps porpotions to the original image size, yet displayed inside a 200x150 px window and hiding any overflow?

    Read the article

  • JavaScript: String Concatenation slow performance? Array.join('')?

    - by NickNick
    I've read that if I have a for loop, I should not use string concation because it's slow. Such as: for (i=0;i<10000000;i++) { str += 'a'; } And instead, I should use Array.join(), since it's much faster: var tmp = []; for (i=0;i<10000000;i++) { tmp.push('a'); } var str = tmp.join(''); However, I have also read that string concatention is ONLY a problem for Internet Explorer and that browsers such as Safari/Chrome, which use Webkit, actually perform FASTER is using string concatention than Array.join(). I've attempting to find a performance comparison between all major browser of string concatenation vs Array.join() and haven't been able to find one. As such, what is faster and more efficient JavaScript code? Using string concatenation or Array.join()?

    Read the article

1