I know in the scheme of things its probably a low priority issue; but I just wanted to bump this because it is still not fixed and even though I don't actually use this personally I find this error annoying for some reason.
Looking at the code quickly it seems the root of the problem is the base width of 48px; which is 10px to short,Here is my solution.
In the new_code function, these lines:
width = 398;
if (new_code_width) width=parseInt(new_code_width)+48;
if (new_code_duck=='yes') width+=75;
else if (new_code_duck=='small') width+=34
should be replaced with these
width = 408; /* This corrects the default value */
if (new_code_width) width=parseInt(new_code_width) + 58; /* +10px to base */
if (new_code_duck=='yes') width+=75;
else if (new_code_duck=='small') width+=34; //no longer implemented?
or alternatively these:
width = (!new_code_width) ? 408 : parseInt(new_code_width) + 58;
width = width + ((new_code_duck==='yes') ? 75 : 0);
This last change isn't required, but will if the user has js disabled their width defaults to 550px which is to large.
- <pre id="code"><iframe src="http://duckduckgo.com/search.html?prefill=Search DuckDuckGo" style="overflow:hidden;margin:0;padding:0;width:408px;height:40px;" frameborder="0"></iframe></pre>
on side note.. which can probably be ignored.. not sure if this was done intentionally but 'width' is never declared locally (first line of new_code()); I couldn't see a reason why you would need to attach it to the window object, although completely unnecessary I would change it so its declared locally which is better and will prevent a strict JavaScript warning from being generated.