您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

28 行
678 B

  1. wn.page = {
  2. set: function(src) {
  3. var new_selection = $('.inner div.content[_src="'+ src +'"]');
  4. if(!new_selection.length) {
  5. // get from server / localstorage
  6. wn.assets.execute(src);
  7. new_selection = $('.inner div.content[_src="'+ src +'"]');
  8. }
  9. // hide current
  10. $('.inner .current_page').removeClass('current_page');
  11. // show new
  12. new_selection.addClass('current_page');
  13. // get title (the first h1, h2, h3)
  14. var title = $('nav ul li a[href*="' + src + '"]').attr('title') || 'No Title'
  15. // replace state (to url)
  16. state = window.location.hash;
  17. if(state!=src) {
  18. window.location.hash = state;
  19. }
  20. else {
  21. document.title = title;
  22. }
  23. }
  24. }