Advertisement
Guest User

Untitled

a guest
Apr 16th, 2014
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. function ChangeSomeStyles(){
  2. //hide the last two links of TopNav
  3. var container = document.getElementsByTagName("ul")[0];
  4. var lastchild = container.lastChild;
  5. var secondlastchild = container.childNodes[container.childNodes.length-2];
  6. lastchild.style.display = 'none';
  7. secondlastchild.style.display = 'none';
  8. //Show TopNav as it is hidden by default in CSS
  9. document.getElementById('WrapperTopNav').style.display = 'block';
  10. //if homepage, set Footer width to 960
  11. if ((document.URL === "http://testsiteqa/Pages/Default.aspx") || (document.URL === "http://testsitetf/Pages/Default.aspx") || (document.URL === "http://testsite/Pages/Default.aspx")){
  12. document.getElementById('Footer').style.width = '960px';
  13. }
  14. }
  15.  
  16. $(document).ready(){
  17. $('ul li:last-child').hide();
  18. //how do I get the second last li?
  19. $('#WrapperTopNav').css('display','block');
  20. if ((document.URL === "http://testsiteqa/Pages/Default.aspx") || (document.URL === "http://testsitetf/Pages/Default.aspx") || (document.URL === "http://testsite/Pages/Default.aspx")){
  21. $('#Footer').css('width','960px');
  22. }
  23. });
  24.  
  25. var cache = $('ul li');
  26. cache.eq(cache.length-1).hide(); //last one
  27. cache.eq(cache.length-2).hide(); //second one from the last
  28.  
  29. var cache = $('ul li:last-child').hide(); //last one
  30. cache.prev().hide(); //second one from the last
  31.  
  32. var cache = $('ul li');
  33. cache.eq(-1).hide(); //last one
  34. cache.eq(-2).hide(); //second one from the last
  35.  
  36. $('ul > li:gt(-3)').hide();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement