Difference between revisions of "Team:ATOMS-Turkiye/shortcut"

(Created page with " $('.post__article').scrollNav({ sections: 'h2.scroll', subSections: true, sectionElem: 'div', showHeadline: false, headlineText: 'Scroll To', showTopL...")
 
Line 49: Line 49:
 
});
 
});
  
$('#toggle').click(function() {
+
  function toggle_visibility(id) {
    $('#tiger').toggle();
+
      var e = document.getElementById(id);
});
+
      if(e.style.display == 'none')
 +
          e.style.display = 'inline';
 +
      else
 +
          e.style.display = 'none';
 +
    }

Revision as of 09:56, 17 September 2015

$('.post__article').scrollNav({
   sections: 'h2.scroll',
   subSections: true,
   sectionElem: 'div',
   showHeadline: false,
   headlineText: 'Scroll To',
   showTopLink: true,
   topLinkText: 'Top',
   fixedMargin: 40,
   scrollOffset: 140,
   animated: true,
   speed: 500,
   insertTarget: this.selector,
   insertLocation: 'insertBefore',
   arrowKeys: false,
   scrollToHash: true,
   onInit: null,
   onRender: null,
   onDestroy: null

}); var $; var observer_target = document.querySelector('.post__article'); var observer = new MutationObserver(function(mutations) {

 mutations.forEach(function() {
   $.fn.scrollNav('resetPos');
 });

}); var observer_config = {

 attributes: true,
 childList: true,
 characterData: true,
 subtree: true

}; observer.observe(observer_target, observer_config);


$('.box').hide();

// Make sure all the elements with a class of "clickme" are visible and bound // with a click event to toggle the "box" state $('.clickme').each(function() {

   $(this).show(0).on('click', function(e) {
       // This is only needed if your using an anchor to target the "box" elements
       e.preventDefault();
       
       // Find the next "box" element in the DOM
       $(this).next('.box').slideToggle('fast');
   });

});

  function toggle_visibility(id) {
      var e = document.getElementById(id);
      if(e.style.display == 'none')
         e.style.display = 'inline';
      else
         e.style.display = 'none';
   }