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 2 of 2
  1. #1
    Regular Coder
    Join Date
    Feb 2006
    Posts
    262
    Thanks
    23
    Thanked 1 Time in 1 Post

    Post variabalize a function ?

    Good day to you all,
    I'm working on a color picker in javascript and css.
    I have found a script that works, but my problem it is made to choose only 1 color, how can I make my code to work for 5.

    I know that php is a server-side language, but I think I could be able to modify my code in that sense.

    Here is my code :
    PHP Code:

    <!--Sample DIV to show selected color -->

    <
    div id="colorbox" style="width: 100px;  border: 1px solid gray; padding: 10px; background-color: #F1FFCC">
    <
    br />

    </
    div>

    <
    br/>

    <
    div id="colorbox1" style="width: 100px;  border: 1px solid gray; padding: 10px; background-color: #F1FFCC">
    <
    br />

    </
    div>
    <
    br/>
    <
    div id="colorbox2" style="width: 100px;  border: 1px solid gray; padding: 10px; background-color: #F1FFCC">
    <
    br />

    </
    div>
    <
    br/>
    <
    div id="colorbox3" style="width: 100px;  border: 1px solid gray; padding: 10px; background-color: #F1FFCC">
    <
    br />

    </
    div>
    <
    br/>
    <
    div id="colorbox4" style="width: 100px;  border: 1px solid gray; padding: 10px; background-color: #F1FFCC">
    <
    br />

    </
    div>


    <
    script type="text/javascript">



    //*** CUSTOMIZE mkcolor() function below to perform the desired action when the color picker is being dragged/ used

    //*** Parameter "v" contains the latest color being selected

    function mkColor(v){

    //** In this case, just update DIV with ID="colorbox" so its background color reflects the chosen color

    $S('colorbox').background='#'+v;

    }



    loadSV(); updateH('F1FFCC');



    </script> 
    Thanks !

  • #2
    Regular Coder
    Join Date
    Apr 2006
    Posts
    117
    Thanks
    2
    Thanked 0 Times in 0 Posts
    So you want to convert this to PHP?


  •  

    Posting Permissions

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