Guest User

Untitled

a guest
Jul 18th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. <li><h3><a href="#" target="_blank" id="feature1" name="feature1">What do I know about javascript?</a></h3>
  2. <div class="check_list_wrap feature1">Not a lot, apparently.</div>
  3. </li>
  4.  
  5. <script type="text/javascript">
  6. $(function() {
  7. $("#listfeatures h3 a").toggle(function(){
  8. $(this).addClass("check_list_selected");
  9. }, function () {
  10. $(this).removeClass("check_list_selected");
  11. });
  12. $("#listfeatures h3 a").click(function() {
  13. $("."+this.id).slideToggle('fast');
  14. return false;
  15. });
  16. });
  17. </script>
  18.  
  19. $(document).ready(function() {
  20. if(location.hash) {
  21. var id = location.hash.slice(1); //Get rid of the # mark
  22. var elementToShow = $("#" + id); //Save local reference
  23. if(elementToShow.length) { //Check if the element exists
  24. elementToShow.slideToggle('fast'); //Show the element
  25. elementToShow.addClass("check_list_selected"); //Add class to element (the link)
  26. }
  27. }
  28. });
Add Comment
Please, Sign In to add comment