Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Feb 2008
    Posts
    50
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Fix This code for $5

    1) Project Details: (be as specific as possible): I want you to fix this code so it would work in IE and firefox. Also The code does not switch the style more then once on firefox with the current state it is in. Adding the .css extension will make it not switch the style at all. I do, however, have the files with the correspondingly names 1.css, 2.css, 3.css in the same directory as 1, 2, 3 if that will help making a working code.
    Code:
    <head>
    <link href="http://www.igotacha.com/myspace/hearts/1" rel="stylesheet" id="css1" type="text/css" />
    <script type="text/javascript">
    
    function change(){
    document.getElementById('css1').href='http://www.igotacha.com/myspace/hearts/2';
    document.getElementById('css1').href='http://www.igotacha.com/myspace/hearts/3';
    }
    </script>
    </head>
    <body>
    <select id="css1">
    <option value="1" onclick="change();">Green N Black Hearts</option>
    <option value="2" onclick="change();">Green N Black Hearts2</option>
    <option value="3" onclick="change();">Green N Black Hearts3</option>
    </select>
    </body>
    2) Payment Amount: $5

    3) Payment method/ details (Paypal, check? Timeline?): Paypal, mail

    4) Additional Info (about project or potential bidders):
    Last edited by 13lue; 02-28-2008 at 12:34 AM.

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    Send a 1, 2 or 3 to the change() function, i.e. onclick="change(1);".

    Add an argument to the change() function i.e. change(cssValue) {} and append it to the href assignment, i.e. document.getElementById('css1').href='http://www.igotacha.com/myspace/hearts/' + cssValue;.

  • #3
    New Coder
    Join Date
    Feb 2008
    Posts
    50
    Thanks
    3
    Thanked 0 Times in 0 Posts
    May i ask that you modify the code? I'm new and what you just said confuses me.

  • #4
    New Coder
    Join Date
    May 2005
    Location
    Cebu, Philippines
    Posts
    46
    Thanks
    1
    Thanked 10 Times in 10 Posts
    This is what Fumigator meant:

    Code:
    <head>
    <link href="http://www.igotacha.com/myspace/hearts/1" rel="stylesheet" id="css1" type="text/css" />
    <script type="text/javascript">
    
    function change(cssValue){
    document.getElementById('css1').href='http://www.igotacha.com/myspace/hearts/'+cssValue;
    }
    </script>
    </head>
    <body>
    <select id="css1">
    <option value="1" onclick="change(1);">Green N Black Hearts</option>
    <option value="2" onclick="change(2);">Green N Black Hearts2</option>
    <option value="3" onclick="change(3);">Green N Black Hearts3</option>
    </select>
    </body>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •