A Pen by Dmitry Rozhkov on CodePen.
Created
June 13, 2016 10:23
-
-
Save anonymous/59c170dc33321c459e3aec8d7644a620 to your computer and use it in GitHub Desktop.
JSON , quotes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div id="b" class="quotes"> | |
| цитата | |
| </div> | |
| <div id="c" class="author"> | |
| автор | |
| </div> | |
| <button id="a">new quote</button> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $("#a").click(function() { | |
| $.getJSON("http://api.forismatic.com/api/1.0/?method=getQuote&lang=ru&format=jsonp&jsonp=?", function(z) { | |
| $("#b").html(JSON.stringify(z["quoteText"])); | |
| $("#c").html(JSON.stringify(z["quoteAuthor"])); | |
| }); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| body { | |
| background-image: url(http://cdn.fishki.net/upload/post/201406/20/1278835/w6kdytk7-js.jpg); | |
| background-size: 100%; | |
| height: 0 auto; | |
| } | |
| .quotes { | |
| margin: 20% 20% 0% 20%; | |
| color: white; | |
| font-size: 2em; | |
| width: 60%; | |
| height: 20%; | |
| background-color: rgba(255, 255, 255, 0.1); | |
| text-align: center; | |
| } | |
| .author { | |
| margin: 1% 20% 0% 20%; | |
| color: white; | |
| font-size: 2em; | |
| width: 60%; | |
| height: 20%; | |
| background-color: rgba(255, 255, 255, 0.1); | |
| text-align: center; | |
| } | |
| button { | |
| margin: 1% 44% 0% 44%; | |
| width: 12%; | |
| background-color: #393E46; | |
| position: relative; | |
| font-size: 1.5em; | |
| text-decoration: none; | |
| color: #fff; | |
| border-radius: 5px; | |
| background-color: rgba(255, 255, 255, 0.1); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" /> | |
| <link href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.1/animate.min.css" rel="stylesheet" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment