Random quotes from Winnie the Pooh
A Pen by jordan rhea on CodePen.
| <img class="picFrame" src="http://www.cafeios.net/wp-content/uploads/2013/06/Winnie-the-pooh-classic-pictures-pooh1_1489609c.jpg"> | |
| <div class="quoteDiv"></div> |
| var quoteArray = ['You can\'t stay in your corner of the forest waiting for others to come to you. You have to go to them sometimes.', | |
| 'Some people care too much. I think it\'s called love.', | |
| 'It is more fun to talk with someone who doesn\'t use long, difficult words but rather short, easy words like \"What about lunch?\”', | |
| 'I think we dream so we don\’t have to be apart for so long. If we\’re in each other\’s dreams, we can be together all the time.', | |
| 'People say nothing is impossible, but I do nothing every day.', | |
| 'Rivers know this: there is no hurry. We shall get there some day.', | |
| 'If the person you are talking to doesn\'t appear to be listening, be patient. It may simply be that he has a small piece of fluff in his ear.', | |
| 'I used to believe in forever, but forever\'s too good to be true', | |
| 'I\'m not lost for I know where I am. But however, where I am may be lost.', | |
| 'Some people talk to animals. Not many listen though. That\'s the problem.', | |
| 'When you see someone putting on his Big Boots, you can be pretty sure that an Adventure is going to happen.', | |
| 'A bear, however hard he tries, grows tubby without exercise.' | |
| ]; | |
| function fillQuoteDiv() { | |
| var rand = Math.floor(Math.random() * ((quoteArray.length - 1) - 0 + 1)) + 0; | |
| $('.quoteDiv').append('<h2><q>' + quoteArray[rand] + '</q><br><h3 class="author"> -A. A. Milne</h3></h2>').fadeIn(); | |
| } | |
| $(document).ready(function() { | |
| fillQuoteDiv(); | |
| $('.picFrame').click(function() { | |
| $('.quoteDiv').fadeOut(function() { | |
| $(this).empty(); | |
| fillQuoteDiv(); | |
| }); | |
| }); | |
| }); |
| <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> |
| .picFrame { | |
| border: 5px solid black; | |
| display: block; | |
| margin-left: auto; | |
| margin-right: auto; | |
| } | |
| .picFrame:hover { | |
| border-color: red; | |
| } | |
| .quoteDiv { | |
| font-family: 'Gloria Hallelujah', cursive; | |
| margin-left: 30px; | |
| margin-right: 30px; | |
| display: none; | |
| } | |
| .author { | |
| text-align: right; | |
| margin-right: 90px; | |
| } |
Random quotes from Winnie the Pooh
A Pen by jordan rhea on CodePen.