-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Names instead of Widths as an option? #10
Comments
@Shapper That was actually something I was already meaning to do—I'll make sure to include it in next update. Thanks for the reminder :] Also be advised it's |
I will be waiting for the change ... Any idea when it will be available? It seems logic to have the names option. But great work. I am using Response on a project and it works great. Thank You, |
@Shapper I just updated the source in the repo to version 0.6.0 and it has what you seek. You have to define a custom test. Like this—this works: Response.addTest('myCustom', (function(R) {
// The hash's keys must match the breakpoint nicknames:
var hash = { lo: 0, med: 481, hi: 961 };
return function(breakpoint) {
return R.viewportW() >= hash[breakpoint];
};
}(Response))).create({
prefix: 'my-' // specify a prefix
, prop: 'myCustom' // must match first parameter of .addTest()
, breakpoints: ['lo', 'med', 'hi'] // must be ordered lowest to highest
, dynamic: true // because it changes on resize
}); and use: <div data-my-lo="looooooo"
data-my-med="meeeeed"
data-my-hi="hiiiiiii"
>fallback content</div> |
Hello,
At the moment Response uses the following syntax:
Imagine that later on I need to change the breakpoint 1025 ro 1020 ...
Then I will be forced to change the data-src1025 in all images.
Wouldn't it be possible to associated breakpoints values to names?
For example:
1025 would be "desktop", 760 would be "Tablet" ...
Then the images would become:
So in Response.Create there would be an option to associate widths to names as an option.
What do you think?
Thank You,
Miguel
The text was updated successfully, but these errors were encountered: