Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $.noConflict();
- jQuery(document).ready(function($){
- /*
- * Add custom class when dropdown menu is shown (active state), to enable styling.
- * Use `.siblings` instead of `.parent` to target adjacent elements.
- */
- $('.collapse').on('show.bs.collapse hide.bs.collapse', function() {
- $(this).parent('li').toggleClass('selected');
- });
- /*
- * Automatically close collapsible menu when a dropdown menu is opened,
- * so that no two menus aren't open at any given time.
- * http://stackoverflow.com/a/19716863/1071413
- */
- $('.dropdown').click(function(){
- if($('#nav-searchform').hasClass('in'))
- $('#nav-searchform').collapse('toggle');
- });
- /*
- * Lazyload Disqus comments using Scrollspy (Twitter Bootstrap)
- */
- $('#comments').waypoint(function () {
- // Remove this once dev is over
- var disqus_developer = 1;
- var disqus_shortname = 'paulund';
- $(function() {
- var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
- dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
- (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
- })();
- }, { offset: '100%', triggerOnce: true });
- /*$('#comments').waypoint(function () {
- // Remove this once dev is over
- var disqus_developer = 1;
- var disqus_shortname = 'paulund';
- $.ajax({
- type: "GET",
- url: "http://" + disqus_shortname + ".disqus.com/embed.js",
- dataType: "script",
- cache: true
- });
- }, { offset: '100%', triggerOnce: true });*/
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement