Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. //jQuery to collapse the navbar on scroll
  2. $(window).scroll(function() {
  3. if ($(".navbar").offset().top > 50) {
  4. $(".navbar-fixed-top").addClass("top-nav-collapse");
  5. } else {
  6. $(".navbar-fixed-top").removeClass("top-nav-collapse");
  7. }
  8. });
  9.  
  10. $(function() {
  11. $('a.page-scroll').bind('click', function(event) {
  12. var $anchor = $(this);
  13. $('html, body').stop().animate({
  14. scrollTop: $($anchor.attr('href')).offset().top
  15. }, 1500, 'easeInOutExpo');
  16.  
  17. if($($anchor).closest('ul').hasClass('dropdown-menu')){
  18. $($anchor).closest('ul').parent().siblings().removeClass('active');
  19. $($anchor).closest('ul').parent().addClass('active');
  20. }else{
  21. $($anchor).parent().siblings().removeClass('active');
  22. $($anchor).parent().addClass('active');
  23. }
  24. event.preventDefault();
  25. });
  26. });
  27.  
  28. <script type="text/javascript">
  29. $(window).ready(function(){
  30. $('div[class^="content-section"]').css('min-height', $(window).height());
  31. })
  32. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement