topshopandtea

script

Aug 3rd, 2013
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. <script type="text/javascript">
  2.  
  3. $(function(){ // document ready
  4.  
  5. var stickyTop = $('#desc').offset().top; // returns number
  6.  
  7. $(window).scroll(function(){ // scroll event
  8.  
  9. var windowTop = $(window).scrollTop(); // returns number
  10.  
  11. if (stickyTop < windowTop) {
  12. $('#desc').css({ position: 'fixed', top: 0 });
  13. }
  14. else {
  15. $('#desc').css('position','static');
  16. }
  17.  
  18. });
  19.  
  20. });
  21.  
  22. </script>
  23.  
  24.  
  25. ------------------------------------>
  26.  
  27. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
  28.  
  29. <script>
  30. $(document).ready(function(){
  31.  
  32. $(".slidingDiv").hide();
  33. $(".show_hide").show();
  34.  
  35. $('.show_hide').toggle(function(){
  36. $(".slidingDiv").slideDown(
  37. function(){
  38. $("#navigation").text("navigation")
  39. }
  40. );
  41. },function(){
  42. $(".slidingDiv").slideUp(
  43. function(){
  44. $("#navigation").text("navigation")
  45. }
  46. );
  47. });
  48. });
  49. </script>
  50.  
  51. ---------------------------------------->
Advertisement
Add Comment
Please, Sign In to add comment