Web Analytics Made Easy -
StatCounter set image as background?? - CodingForum

Announcement

Collapse
No announcement yet.

set image as background??

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • set image as background??

    Hey yall!

    I need a script that it set the image that you want to set when you located that file in your computer (or the url)

    by using the button "brose" then popup a window to locate image

    and then it set it as background.

    Any one know how to do??

    THx all
    TT

  • #2
    <FORM NAME="formName">
    <INPUT TYPE="FILE" NAME="file">
    <INPUT TYPE="BUTTON" OnClick="bg();" VALUE="click click">
    </FORM>
    <SCRIPT>
    function bg() {
    var theForm = document.formName;
    document.body.style.backgroundImage = theForm.file.value;
    }
    </SCRIPT>
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

    Comment


    • #3
      I try the above javascript, and it doesn't work..

      Then try put the <script> into the <head><script>dfskajfd </script></head> then the form.. And it still doesn't work!

      Any can help me out?? IT popups an error window with Yes or No button..
      TT

      Comment


      • #4
        Hey.. This time I try the codes.. there is no error but it won't set background image for me. it only set it to white colors..
        <FORM NAME="hh">
        <INPUT TYPE="file" NAME="ff">
        <INPUT TYPE="button" onclick="bg();" VALUE="Select">
        </FORM>
        <SCRIPT>
        function bg() {
        var theForm = document.hh;
        document.body.style.background="bg('theForm.ff.value') fixed"
        }
        </SCRIPT>

        If i use
        document.body.style.backgroundImage="bg('theForm.ff.value') fixed"

        this will give me error..

        Can any one help me??
        TT

        Comment

        Working...
        X