Advertisement
Guest User

routing.js

a guest
Feb 24th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. <script>
  2. var hash = document.location.hash;
  3. var prefix = "profile.php?tab_";
  4. if (hash) {
  5. $('.nav-tabs a[href='+hash.replace(prefix,"")+']').tab('show');
  6. }
  7.  
  8. // Change hash for page-reload
  9. $('.nav-tabs a').on('shown.bs.tab', function (e) {
  10. window.location.hash = e.target.hash.replace("#", "#" + prefix);
  11. });
  12.  
  13.  
  14.  
  15.  
  16.  
  17. </script>
  18. <script>
  19. $('#myTab a[href="#profile"]').tab('show'); // script for activating bs tabbes but it's not working:|
  20. $('#myTab a:menu1').tab('show');
  21. $('#myTab a:menu2').tab('show');
  22.  
  23. </script>
  24. <script>
  25. var app = angular.module("myApp", ["ngRoute"]); // script for defining routes
  26. app.config(function($routeProvider) {
  27. $routeProvider
  28. .when("/", {
  29. templateUrl : "profile_info.php"
  30. })
  31. .when("/menu1", {
  32. templateUrl : "rating_fund.php"
  33. })
  34. .when("/menu2", {
  35. templateUrl : "message.php"
  36. })
  37. .when("/blue", {
  38. templateUrl : "tarh_summary.php"
  39. });
  40. });
  41.  
  42.  
  43. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement