main.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. $(document).ready(function() {
  2. // var myURL = parseURL(document.URL);
  3. // var myURL_source = myURL.protocol + "://" + myURL.host + ":" + myURL.port + myURL.path;
  4. // var url0 = myURL_source + ".json?callback=hey";
  5. window.lang = new Lang("en");
  6. // $.getJSON(url0, function(data){
  7. // }).complete(function() {
  8. // langSwitch("tr");
  9. // });
  10. //
  11. // $("#en-switcher").css("color", "#999999");
  12. //
  13. // langSwitch = function(lang){
  14. // window.lang.change(lang);
  15. // if(window.lang.currentLang == "en"){
  16. // $("#en-switcher").css("color", "#999999");
  17. // }else if(window.lang.currentLang == "tr"){
  18. // $("#tr-switcher").css("color", "#999999");
  19. // }
  20. // };
  21. //
  22. // $("#lang-switcher a").click(function(e){
  23. // e.preventDefault();
  24. // if(window.lang.currentLang == "tr"){
  25. // $(this).css("color", "#999999");
  26. // $("#en-switcher").css("color", "#B7005B");
  27. // } else if(window.lang.currentLang == "en") {
  28. // $(this).css("color", "#999999");
  29. // $("#tr-switcher").css("color", "#B7005B");
  30. // }
  31. // });
  32. var $root = $('html, body');
  33. $('a.scroll').click(function() {
  34. var href = $.attr(this, 'href');
  35. console.log(href);
  36. $root.animate({
  37. scrollTop: $(href).offset().top - 50
  38. }, 500, function () {
  39. window.location.hash = href;
  40. });
  41. return false;
  42. });
  43. });