Current Resolution: ×

rwdjs is deprecated

I now recommend the use of enquire.js.


View on GitHub
In this example, we use 3 rules. Note that both paragraphs are hidden by default with CSS.
  1. One rule to show the "small" paragraph if the resolution is 320px or less
  2. One rule to show the "large" paragraph if the resolution is more than 320px
  3. And a final rule to change the text of the "large" paragraph to "Extra Large!" if the resolution is more than 1024px

Large

Small

A more realistic example might be that on a smaller screen, we wish to display content inline while on a larger screens we wish to use jQuery UI tabs. (Hiding the UL is done with CSS!)

Lorem Ipsum

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec vel molestie orci. Nam efficitur lorem sollicitudin odio consectetur, a pretium eros volutpat. Etiam elementum, elit quis tristique ullamcorper, erat erat suscipit eros, in laoreet justo quam non justo. Suspendisse auctor in nulla feugiat convallis. Nullam at porttitor diam. Praesent semper, massa in eleifend lobortis, purus tellus scelerisque urna, in ultrices erat augue dapibus augue. Aenean molestie vel diam sed malesuada. Aenean vestibulum lacus dui, in faucibus purus feugiat sed. Quisque felis ex, porta ut enim pulvinar, mattis convallis dui.

Bacon Ipsum

Bacon ipsum dolor amet cupim ham hock t-bone corned beef spare ribs meatball filet mignon ball tip tail doner short loin sausage short ribs alcatra frankfurter. Bacon leberkas rump turkey short ribs, shankle beef ribs pastrami pork chop picanha biltong salami. Flank pancetta drumstick ham. Tail chuck pork chop fatback.

Cupcake Ipsum

Cupcake ipsum dolor. Sit amet macaroon cotton candy lemon drops. Liquorice sweet tiramisu chocolate cake. Pie tart bonbon pie. Chocolate cake gummies lollipop lollipop croissant cheesecake cake brownie. Marzipan jelly bear claw croissant sweet. Jelly-o soufflé dessert danish icing powder. Ice cream lemon drops cookie powder lollipop. Sesame snaps biscuit candy pudding. Candy dessert tiramisu topping topping lollipop. Caramels tiramisu halvah icing tootsie roll bear claw. Brownie carrot cake pastry pie jelly sesame snaps apple pie.