ryanve / response.js

Responsive design toolkit
http://responsejs.com
Other
801 stars 123 forks source link

Default img src = null #25

Open Jakobud opened 11 years ago

Jakobud commented 11 years ago

Take a look at the following:

http://jsfiddle.net/N2Mtj/

Why does the default img src become null in the DOM when it needs to be shown?

ryanve commented 11 years ago

jsfiddle.net/zmU9n/12/ shows this issue in the console. Locally I was able to trace the issue to something that changed between 0.7.1 and 0.7.2. Revert to 0.7.1 until we fix this. Thanks for reporting this. I'm surprised no one else ran into it.

Jakobud commented 11 years ago

I don't know if it's related, but it appears that if I try to use multiple prefixes in the setup, it ignores all the prefixes except for the last one specified.

ryanve commented 11 years ago

It is. The issue only occurs when aliases (extra prefixes) are specified. Removing the aliases solves it. /13 and (better) /15 both work. The extra keys are throwing off the array containing the associated values.

Jakobud commented 11 years ago

Ah okay. I was trying to debug it but couldn't figure it out.

What exactly is the point of specifying multiple prefixes? If I'm simply using pixels as my breakpoints, I can use any prefix I want right? The really isn't a different between min-width- and r or some other random prefix is there?

ryanve commented 11 years ago

Correct—you can use any prefix you want, and you only need one. The aliases were added in 0.3 to accomodate back-compat. with earlier versions. They add flexibility but are best to avoid when possible. Modes are autodetected since 0.3 by a private function called detectMode. The defaults like "min-width-" and "min-device-width-" are readable. Something non-descriptive like "r" is useful if experimenting between using "width" and "device-width".