Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
185
rated 0 times [  191] [ 6]  / answers: 1 / hits: 16232  / 14 Years ago, fri, december 24, 2010, 12:00:00

I am making a javascript bookmarklet that resizes all images, periodically.



javascript: function x(){
for(i=0;i<=document.getElementsByTagName('img').length;i++)
document.getElementsByTagName('img')[i].width+=1;
};
t = window.setTimeout(x(),100);
void(0);


But it runs only once. What is the problem here??


More From » bookmarklet

 Answers
68

Are you looking for setInterval() instead of setTimeout() by any chance?



t = window.setInterval(x(),100);

[#94499] Wednesday, December 22, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
lizet

Total Points: 479
Total Questions: 96
Total Answers: 113

Location: Mexico
Member since Sun, Jul 25, 2021
3 Years ago
;