Skip to content
Browse files

Update README.markdown

  • Loading branch information...
1 parent b56b542 commit f7ff173ba3b568853432ed292d1365d9682c91cc @pyrsmk committed May 21, 2012
Showing with 8 additions and 8 deletions.
  1. +8 −8 README.markdown
View
16 README.markdown
@@ -10,30 +10,30 @@ The idea to develop molt comes from a few observations:
- [responsiveImages](https://github.com/jackfranklin/responsiveImages) is interesting but can't handle dynamic content generation on server side (with template engines)
- it also could happen that we don't need images at all for 320px devices (per example)
-Molt try to solve all these problems.
+Molt try to solve all of these problems.
-Also, it's [W](https://github.com/pyrsmk/W) dependent and so can handle responsive events (it should be a good idea to read the W README file to well understand how it interacts with molt). So, if you've planned to use W in your website take the `molt-xxx.min.js` version, otherwise please take the `molt-W-xxx.min.js` one.
+Also, it's [W](https://github.com/pyrsmk/W) dependent and can handle responsive events (it should be a good idea to read the W README file to well understand how it interacts with molt). So, if you've planned to use W in your website take the `molt-xxx.min.js` version, otherwise please take the `molt-W-xxx.min.js` one.
Syntax
------
-A molt image is set as a regular `img` tag on your HTML body (for dynamic generation purposes on server side), but with an `url` attribute:
+A molt image is set as a regular `img` tag on your HTML body (for dynamic generation purposes on server side), but with a `data-url` attribute:
<img data-url="images/img{320,1024}.jpg" data-display="block" alt="">
Numbers in brackets are modes. The selected mode will replace brackets: if the selected mode is 320 then the URL will look like `images/img320.jpg`. A mode is chosen like this:
-- if the current window/device width is, let's say, 240px then molt will choose the 320 mode
+- if the current window/device width is about, let's say, 240px then molt will choose the 320 mode
- for a 480px width, the 320 mode again
- but if a 1280px resolution is detected, the 1024 mode is chosen
You can also map modes into different values, for example using `images/img-{320:small,1024:huge}.jpg` to load either `img-small.jpg` or `img-huge.jpg`.
-Moreover, note that you can 'negate' a mode, like `!320`, to make your images hidden for that mode (please take a look at the listener example to know how deal with that special mode).
+Moreover, note that you can 'negate' a mode, like `!320`, to make your images hidden for that mode.
-Finally, the `data-display` attribute is used when a previously hidden image (by a negative mode) shows up again. Currently, there's no way to distinguish which display CSS property is set on a node (really, no way at all, coming from a lack of specs). So, molt will reset that display property to the `display` attribute value, `inline` otherwise.
+Finally, the `data-display` attribute is used when a previously hidden image (by a negative mode) shows up again. Currently, there's no way to distinguish which display CSS property is set on a node (really, no way at all, coming from a lack of specs). So, molt will reset that display property to the `data-display` attribute value, `inline` otherwise.
-You can apply several properties or launch some actions on a specific refreshed node (when a zoom event has been catched, per example) by listening its refreshing state:
+You can apply several properties or launch some actions on a specific refreshed image (when a zoom event has been catched, per example) by listening its refreshing state:
// Get your image node
var img=$('#foo img')[0];
@@ -50,7 +50,7 @@ You can apply several properties or launch some actions on a specific refreshed
}
);
-Nodes are passed to the callback with the `this` keyword and current mode is directly accessible too. But, note that callbacks are only launched on non-negative modes.
+Image nodes are passed to the callback with the `this` keyword and current mode is directly accessible too. But, note that callbacks are only launched on non-negative modes.
To finish, molt must discover all your molt images to automatically manage them all:

0 comments on commit f7ff173

Please sign in to comment.
Something went wrong with that request. Please try again.