加入js交互的菜单 屏幕适配
2017-09-18 15:57
190 查看
<!DOCTYPE html> <head> <script src="/assets/jquery.js"></script> <link href='https://fonts.googleapis.com/css?family=Londrina+Shadow' rel='stylesheet' type='text/css'> <style> body { font-family: helvetica, sans-serif; margin: 0 auto; max-width: 600px; background: #232323; } div { height: 200px; background-size: cover; position: relative; margin: 40px 0 0 0; border-radius: 12px; } h1 { font-family: 'Londrina Shadow', cursive; text-align: center; font-size: 75px; color: #aaaaaa; margin: 60px 0 0 0; } h2 { text-align: center; color: #bbbbbb; margin: 0px 0 70px 0; } p { color: rgba(255,255,255,1); background: black; background: linear-gradient(bottom, rgba(0,0,0,1), rgba(0,0,0,.4)); background: -webkit-linear-gradient(bottom, rgba(0,0,0,1), rgba(0,0,0,.4)); background: -moz-linear-gradient(bottom, rgba(0,0,0,1), rgba(0,0,0,.4)); padding: 10px; line-height: 28px; text-align: justify; position: absolute; bottom: 0; margin: 0; height:30px; transition:height .5s; -webkit-transition:height .5s; -moz-transition:height .5s; } small{ opacity:0; } .show-description p{ height:150px; } .show-description small{ opacity:1; } .first{ background-image: url("http://dash.ga.co/assets/firstcourse.jpg"); } .second{ background-image: url("http://dash.ga.co/assets/secondcourse.jpg"); } .dessert{ background-image: url("http://dash.ga.co/assets/dessertcourse.jpg"); } .price { float: right; } @media(max-width:500px){ h1{ font-size:50px; margin-top:20px; line-height:40px; } h2{ font-size:20px; margin:20px 0 30px 0; } div{ margin:20px 12px 0px 12px; } p{ font-size:20px; line-height:24px; } small{ font-size:16px; } } </style> </head> <body> <h1>esha's restaurant</h1> <h2>a New York City eatery</h2> <div class="first"> <p>welsh onion soko <span class="price">$14</span><br /> <small>Mustard sierra leone bologi kale chard beet greens black-eyed pea sorrel amaranth garlic tigernut spring onion summer purslane asparagus lentil. </small></p> </div> <div class="second show-description"> <p>pastrami boudin tongue <span class="price">$22</span><br /> <small>Tri-tip capicola kielbasa salami brisket chicken rump strip steak drumstick. Meatloaf chuck boudin ribeye pork jowl. Andouille bacon jowl meatloaf pork loin prosciutto bresaola.</small></p> </div> <div class="dessert"> <p>fruitcake marzipan pudding dragee <span class="price">$8</span><br /> <small>Lollipop tart cotton candy jelly-o carrot cake apple pie cupcake. Jelly-o bear claw ice cream candy canes.</small></p> </div> <script>$('div').on('click',function(){ $(this).toggleClass('show-description'); })</script> </body>
相关文章推荐
- cocos2d-js 3.0 屏幕适配方案 分辨率适应
- cocos2d-js关于对话框Layer的屏幕适配
- 客户端交互设计适配之——屏幕大小
- ocos2d-JS 屏幕适配相关内容
- [转]cocos2d-js 3.0 屏幕适配方案 分辨率适应
- js来获取所有屏幕适配的总结
- cocos-js,屏幕适配
- 客户端交互设计适配之——屏幕大小
- 手机浏览器客户端交互设计适配之——屏幕大小
- js适配屏幕大小
- 关于FlexPaper 2.1.2版本 二次开发 Logo 、打印、搜索、缩略图、添加按钮、js交互、右键菜单等相关问题
- JavaScript强化教程——cocosjs屏幕适配方案
- cocos2d-js 系列[1] 屏幕的适配
- JavaScript强化教程 —— Cocos2d-JS的屏幕适配方案
- MetaHandler.js:移动端适配各种屏幕
- cocos2d-JS 屏幕适配(5种适配模式)
- JavaScript强化教程——cocosjs屏幕适配方案
- 客户端交互设计适配之——屏幕大小
- Cocos2d-JS 屏幕适配相关内容
- Cocos2d-js 3.0 屏幕适配方案 分辨率适应