Guest User

Untitled

a guest
Nov 18th, 2017
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. var query = window.location.search.replace("?page=" , "");
  2.  
  3. var advName = [
  4. {
  5. "name" : "1111111"
  6. },
  7. {
  8. "name" : "2222222"
  9. },
  10. {
  11. "name" : "333333333"
  12. },
  13. {
  14. "name" : "444444444"
  15. },
  16. {
  17. "name" : "5555555555"
  18. }
  19. ];
  20.  
  21. var advTitle = function(){
  22. situation = "page-" + query;
  23. val = $("#" + situation).index(".advBox li");//jQuery使用
  24. document.title = advName[val].name;
  25. }
  26. advTitle();
  27.  
  28. window.onload = function(){
  29. $(advBg).addClass(situation);//jQuery使用
  30. val = $(this).index(".advBox li");//jQuery使用
  31. var charaClick = function(){
  32. i = "";
  33. for(var i = 0; i < Selector.length; i++){
  34. Selector[i].addEventListener('click', function(e) {
  35. val = $(this).index(".advBox li");//jQuery使用
  36. getAttr = this.getAttribute('id');
  37. advBg.setAttribute("class", getAttr);
  38. replace = getAttr.replace("page-" , "");
  39. },false);
  40. }
  41. }
  42. charaClick();
  43. };
Add Comment
Please, Sign In to add comment