Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Need help from Web developer - cash on offer!

Options
  • 03-12-2015 5:41pm
    #1
    Registered Users Posts: 230 ✭✭


    Hi Folks,

    I desperately need some expert help on my webpage. I have spent about 30 hours trying to get a navigation tab to show that's it's active by maintaining the hover colour when clicked on but have had no success. I have had tons of suggestions from people on stackoverflow.com but none of it works. My server side lecturer and my client side lecturer spent 4 hours on it yesterday and couldn't get it working either. It has gotten to the stage where I will need to meet someone with real expertise. I'll give 20 quid to anyone who can get it working. 50 quid if you hang around and do a few more jobs for me. Can meet Sunday evening if it suits. I am writing this on my phone but I will post the link to my stackoverflow.com query later. But in the mean time if you search for questions by NiallL you will find it.


Comments

  • Registered Users Posts: 230 ✭✭Deadalus


    Mr.S wrote: »
    :eek:

    I see the error of my ways there.

    Still I live in hope.


  • Registered Users Posts: 230 ✭✭Deadalus


    How about this then.

    I just give you my cloud 9 login details and you can have a quick look yourself?


  • Moderators, Society & Culture Moderators Posts: 17,642 Mod ✭✭✭✭Graham


    Link to Deadalus StackOverflow Query for anyone that's curious:

    http://stackoverflow.com/questions/34051539/how-to-make-selected-nav-button-stay-active

    Looks like one of the responders has posted a link to a working example on codepen


  • Registered Users Posts: 230 ✭✭Deadalus


    Graham wrote: »
    Link to Deadalus StackOverflow Query for anyone that's curious:

    http://stackoverflow.com/questions/34051539/how-to-make-selected-nav-button-stay-active

    Looks like one of the responders has posted a link to a working example on codepen


    Yeah and I have tried all versions in my code but with no success. I really need someone to have look with a fresh pair of eyes and see if they can help.

    Any takers? I can pm login details.


  • Registered Users Posts: 339 ✭✭duffman85


    <!DOCTYPE html>
    <html>
    <head>
    <script type="text/javascript" >
    function doClick(x) {
    
    if ( x == 1) {
         document.getElementById("active1").style.backgroundColor = '#99C262';
    
     }
    
     else if (x == 2) {
    
       document.getElementById('active2').style.backgroundColor = '#99C262';
     }
    
       else if (x == 3) {
    
       document.getElementById('active3').style.backgroundColor = '#99C262';
     } 
    
       else if (x == 4) {
    
       document.getElementById('active4').style.backgroundColor = '#99C262';
     } 
    
     else if (x == 5) {
    
       document.getElementById('active5').style.backgroundColor = '#99C262';
     } 
     }
     </script>
     </head>
    <body>
    <nav>
    <ul class ="nav"> <!-- Niall Added-->
    
      <li id='active1' onclick = "doClick(1)">Home</li>
      <li id='active2' ><a href="#" onclick = "doClick(2)">Matches</a></li>
      .... more <li> ...
    </ul>
    </nav>
    </body>
    </html>
    

    I took your original code from your stackoverflow post http://stackoverflow.com/questions/34051539/how-to-make-selected-nav-button-stay-active and modified it to make it work

    Found 2 problems
    - the closing brace } of the doClick function was missing
    - the list item contains a link and has an onClick event handler - do one or the other, the way you had it originally you were clicking the link and not the list item, so doClick wasn't being called.
    As was said on StackOverflow, if you want to keep the current nav button highlighted between pages, that's a little more complicated.


  • Advertisement
  • Registered Users Posts: 6,250 ✭✭✭Buford T Justice


    Is there any particular reason you have it so needlessly complicated?

    Also, are you using jQuery?


  • Moderators, Computer Games Moderators, Technology & Internet Moderators Posts: 19,240 Mod ✭✭✭✭L.Jenkins


    Is this another do my homework thread?


  • Registered Users Posts: 6,250 ✭✭✭Buford T Justice


    Itzy wrote: »
    Is this another do my homework thread?

    Sounds like it. Not a hugely complex issue tbh


  • Moderators, Computer Games Moderators, Technology & Internet Moderators Posts: 19,240 Mod ✭✭✭✭L.Jenkins


    Could see it as a "Give a man a fish..." thread!


  • Registered Users Posts: 230 ✭✭Deadalus


    A little harsh with the doing my homework bit.

    My assignment was to build a website with login, databases, search options functionality etc. This seems like a small part of it but I would like to get it working.

    I'll still get the marks as my code was alright and to be fair two PhD level lecturers spent 4 hours on it and couldn't get it working either and I've only started coding but I take the point.

    Perhaps Boards isn't the place to ask for advice on coding problems.


  • Advertisement
  • Registered Users Posts: 623 ✭✭✭J Madone


    Deadalus wrote: »
    A little harsh with the doing my homework bit.

    I'll still get the marks as my code was alright and to be fair two PhD level lecturers spent 4 hours on it and couldn't get it working either and I've only started coding but I take the point.

    Im sure a thank you for helping me would go a long way here


  • Registered Users Posts: 230 ✭✭Deadalus


    J Madone wrote: »
    Im sure a thank you for helping me would go a long way here

    Of course any assistance is greatly appreciated.


  • Registered Users Posts: 230 ✭✭Deadalus


    duffman85 wrote: »
    <!DOCTYPE html>
    <html>
    <head>
    <script type="text/javascript" >
    function doClick(x) {
    
    if ( x == 1) {
         document.getElementById("active1").style.backgroundColor = '#99C262';
    
     }
    
     else if (x == 2) {
    
       document.getElementById('active2').style.backgroundColor = '#99C262';
     }
    
       else if (x == 3) {
    
       document.getElementById('active3').style.backgroundColor = '#99C262';
     } 
    
       else if (x == 4) {
    
       document.getElementById('active4').style.backgroundColor = '#99C262';
     } 
    
     else if (x == 5) {
    
       document.getElementById('active5').style.backgroundColor = '#99C262';
     } 
     }
     </script>
     </head>
    <body>
    <nav>
    <ul class ="nav"> <!-- Niall Added-->
    
      <li id='active1' onclick = "doClick(1)">Home</li>
      <li id='active2' ><a href="#" onclick = "doClick(2)">Matches</a></li>
      .... more <li> ...
    </ul>
    </nav>
    </body>
    </html>
    

    I took your original code from your stackoverflow post http://stackoverflow.com/questions/34051539/how-to-make-selected-nav-button-stay-active and modified it to make it work

    Found 2 problems
    - the closing brace } of the doClick function was missing
    - the list item contains a link and has an onClick event handler - do one or the other, the way you had it originally you were clicking the link and not the list item, so doClick wasn't being called.
    As was said on StackOverflow, if you want to keep the current nav button highlighted between pages, that's a little more complicated.

    Thanks for this I shall give it a go.


  • Registered Users Posts: 3 jo_joe


    Deadalus,
    did you got any solution for this?
    please PM me othewise


  • Registered Users Posts: 6,250 ✭✭✭Buford T Justice


    Deadalus wrote: »

    Perhaps Boards isn't the place to ask for advice on coding problems.

    And perhaps you should answer the questions that's asked of you if you want some help too.


  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    Perhaps I should pay more attention, but I'm moving house and country at the moment.

    Thread Locked.


    @Deadalus - ask your question, try and learn from the answers. Learning to code is really hard. If you want a job you're not going to be able to wing it and pay your colleagues 20 euros to do it for you. I'm letting the instaban slide this time, which has more to do with my tardyness than you earning that.


This discussion has been closed.
Advertisement