Advertisement
Guest User

Untitled

a guest
Dec 6th, 2013
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $.noConflict();
  2. jQuery(document).ready(function($){
  3.  
  4.     /*
  5.      * Add custom class when dropdown menu is shown (active state), to enable styling.
  6.      * Use `.siblings` instead of `.parent` to target adjacent elements.
  7.      */
  8.     $('.collapse').on('show.bs.collapse hide.bs.collapse', function() {
  9.         $(this).parent('li').toggleClass('selected');
  10.     });
  11.  
  12.  
  13.     /*
  14.      * Automatically close collapsible menu when a dropdown menu is opened,
  15.      * so that no two menus aren't open at any given time.
  16.      * http://stackoverflow.com/a/19716863/1071413
  17.      */
  18.     $('.dropdown').click(function(){
  19.         if($('#nav-searchform').hasClass('in'))
  20.             $('#nav-searchform').collapse('toggle');
  21.     });
  22.  
  23.  
  24.     /*
  25.      * Lazyload Disqus comments using Scrollspy (Twitter Bootstrap)
  26.      */
  27.     $('#comments').waypoint(function () {
  28.  
  29.         // Remove this once dev is over
  30.         var disqus_developer = 1;
  31.  
  32.         var disqus_shortname = 'paulund';
  33.  
  34.         $(function() {
  35.             var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
  36.             dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
  37.             (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
  38.         })();
  39.  
  40.     }, { offset: '100%', triggerOnce: true });
  41.  
  42.     /*$('#comments').waypoint(function () {
  43.  
  44.         // Remove this once dev is over
  45.         var disqus_developer = 1;
  46.  
  47.         var disqus_shortname = 'paulund';
  48.  
  49.         $.ajax({
  50.             type: "GET",
  51.             url: "http://" + disqus_shortname + ".disqus.com/embed.js",
  52.             dataType: "script",
  53.             cache: true
  54.         });
  55.  
  56.     }, { offset: '100%', triggerOnce: true });*/
  57.  
  58. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement