lol very easy javascript i coded but i little thing wont work :P

Discussion in 'JavaScript' started by ps3ubo, Apr 24, 2010.

  1. #1
      <script src="http://code.jquery.com/jquery-latest.js"></script>
    
    <script type="text/javascript">
    
    function doFunky(nav_name)
     {
    
       if(divStatus('mp3s_menu')=="block"){
        nav_from = "mp3s";
       }
    
       if(divStatus('videos_menu')=="block"){
        nav_from = "videos";
       }
    
       if(divStatus('files_menu')=="block"){
        nav_from = "files";
       }
    
    
      $("#" + nav_from + "_menu").fadeOut("slow",function()
       {
        $("#" + nav_name + "_menu").fadeIn("slow");
       });
    
     }
    
     function divStatus(the_thing){
      if (document.getElementById){
       return document.getElementById(the_thing).style.display;
      }
      else{
       if (document.layers){
        return document.the_thing.display;
       }
       else{
        return document.all.the_thing.style.display;
       }
      }
     } 
    </script>
    
    <small><a href="javascript:doFunky('videos')">1</a></small>
    <small><a href="javascript:doFunky('mp3s')">2</a></small>
    HTML:
    it is menna work.. but it doesnt..


    the problem is this:

    it doesnt get the divStatus('files_menu') etc
    BUT it works if i do document.write(divStatus('files_menu'));
    so its the if() function that i have done wrong probs :S whats wrong with it lol
     
    ps3ubo, Apr 24, 2010 IP
  2. ps3ubo

    ps3ubo Peon

    Messages:
    204
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    please remember i might be confused with php as there to similar :S
     
    ps3ubo, Apr 24, 2010 IP
  3. ps3ubo

    ps3ubo Peon

    Messages:
    204
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    *fixed it now* but theres problem still but i will see if i can fix it before asking :p
     
    ps3ubo, Apr 24, 2010 IP