Don't think of it as "+leftpos+". Think of it like this:
"blah blah blah"
+
leftpos
+
"blah blah blah"
The reason you need to use double quotes is because they have to match up with the opening and closing quotes on the other sides.
Let's say the value of leftPos is 10. Then this:
"width=225,height=200,left="+leftPos+",top=0"
will be the same as:
"width=225,height=200,left=10,top=0"
But this:
"width=225,height=200,left='+leftPos+',top=0"
is still just:
"width=225,height=200,left='+leftPos+',top=0"
In the first case, you end the string (it started with a double quote, so you end it with a double quote), then you concatenate the value of leftPos to it, and then you concatenate another string to it (starting and ending with double quotes). In the second case, the whole thing is one big string, from the opening double quote to the closing double quote.
See, the reason you use double quotes here is because you don't *want* the quotes to be part of the string. You want them to end the string, then you do some concatenation, and then you open up a new string. But if you use single quotes in the middle there, then you only have one single string, and the word "leftPos" is nothing more than a few letters within it.