Changeset 1160988
- Timestamp:
- 05/15/2015 08:15:50 AM (11 years ago)
- File:
-
- 1 edited
-
scroll-me-up/trunk/show.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
scroll-me-up/trunk/show.php
r1160984 r1160988 1 <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>2 3 1 <style> 4 5 2 .scroll-up { 6 7 3 width: 50px; 8 9 4 height: 50px; 10 11 5 opacity: 0.7; 12 13 6 position: fixed; 14 15 7 bottom: 50px; 16 17 8 right: 100px; 18 19 9 display: none; 20 21 10 text-indent: -99999px; 22 23 background:url(<?=plugins_url( 'scroll-me-up/scrollup.png', dirname(__FILE__) )?>) no-repeat; 24 25 z-index:99999; 26 11 background:url(<?php echo plugins_url( 'scrollup.png', __FILE__ ); ?> ) no-repeat; 12 z-index:99999; 27 13 } 28 29 14 </style> 30 31 32 33 15 <script> 34 35 16 $(document).ready(function () { 36 37 17 $(window).scroll(function () { 38 39 18 if ($(this).scrollTop() > 100) { 40 41 19 $('.scroll-up').fadeIn(); 42 43 20 } else { 44 45 21 $('.scroll-up').fadeOut(); 46 47 22 } 48 49 23 }); 50 51 24 $('.scroll-up').click(function () { 52 53 25 $("html, body").animate({ 54 55 26 scrollTop: 0 56 57 27 }, 600); 58 59 28 return false; 60 61 29 }); 62 63 30 }); 64 65 31 </script> 66 67 68 69 70 71 32 <a href="#" class="scroll-up">scroll</a> 72 33
Note: See TracChangeset
for help on using the changeset viewer.