Results 1 to 7 of 7

Thread: GetDiv()???

  1. #1

    Thread Starter
    Fanatic Member merhaba's Avatar
    Join Date
    Sep 2002
    Location
    Istanbul,Bartin-Gallipoli(Gelibolu-Canakkale)
    Posts
    601

    GetDiv()???

    Hi there,
    Can anyone explain me how Where I can use GetDiv(aaa,100,200,50-1,1) ..EndDiv?
    What does all that mean?
    Actally I know a lot about javascript but this is the first time I came across this?

    thanks for helping

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906
    As far as I'm aware, there is no function called GetDiv in Javascript. I did a quick Google search and all I got were Javascripts with their own implementations of similarly named functions.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  3. #3

    Thread Starter
    Fanatic Member merhaba's Avatar
    Join Date
    Sep 2002
    Location
    Istanbul,Bartin-Gallipoli(Gelibolu-Canakkale)
    Posts
    601

    GetDiv

    hi again,
    it is not a function .I got it from a javascript game called "HANGMAN"
    GetDiv(...,200,100,50,50,1,0)
    <img src=*.jpg">
    EndDiv
    it was something like this....
    if you can not guess the correct letter an image become visible..in the game

    thanks

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Well, then, how should we know how to use it? Can you tell us where this hangman game is?
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  5. #5

    Thread Starter
    Fanatic Member merhaba's Avatar
    Join Date
    Sep 2002
    Location
    Istanbul,Bartin-Gallipoli(Gelibolu-Canakkale)
    Posts
    601

    GetDiv

    Hi again,
    Here is the game that uses GetDiv....


    <title>JAVASCRIPT - GAMES - www.caoxuan.com - hangman</title>
    </head><style>
    .formTxt{font: 15pt Arialblack}</style>
    <script src=laydiv.js></script>
    <script src=words.js></script>
    <SCRIPT>
    keySet=new Array()
    theWord=Words[parseInt(Words.length*Math.random())]
    cor=new Array
    correct=0 hang=0 test=0
    UsedKeys=""
    GetDiv('div0',300,50,10,10,'',0,0)
    document.write("<img src='0.gif'>")
    EndDiv()
    GetDiv('div1',90,50,10,10,'',0,0)
    document.write("<img src='1.gif'>")
    EndDiv()
    GetDiv('div2',80,115,10,10,'',0,0)
    document.write("<img src='2.gif'>")
    EndDiv()
    GetDiv('div3',130,120,10,10,'',0,0)
    document.write("<img src='3.gif'>")
    EndDiv()
    GetDiv('div4',170,120,10,10,'',0,0)
    document.write("<img src='4.gif'>")
    EndDiv()
    GetDiv('div5',200,120,10,10,'',0,0)
    document.write("<img src='5.gif'>")
    EndDiv()
    GetDiv('div6',200,225,10,10,'',0,0)
    document.write("<img src='6.gif'>")
    EndDiv()
    GetDiv('div7',200,239,10,10,'',0,0)
    document.write("<img src='7.gif'>")
    EndDiv()
    GetDiv('div8',235,110,10,10,'',0,0)
    document.write("<img src='8.gif'>")
    EndDiv()
    GetDiv('div9',235,230,10,10,'',0,0)
    document.write("<img src='9.gif'>")
    EndDiv()
    document.write("<form><table width=650><tr><td align=center><font face=Tahoma><h1>HANGMAN</h1></font><tr><td align=center>")
    for(x=0;x<theWord.length;x++){
    document.write("<input class='formTxt' type=text size=1 value='' readonly>")
    }
    document.write("<tr><td align=center><img src=blnk.gif width=650 height=220>")
    document.write("<tr><td align=center><font face=Tahoma size=1>This is a ",theWord.length,"-letter word.<br>")
    document.write("Try to guess and press the alphabet keys on your keyboard<br>You have 10 guesses<br>If the hangman sketch is complete, you lose.<p>")
    document.write("(If you want the this game for your site, ")
    document.write("<a href='http://www.caoxuan.com/zip4free/request.html' target=_blank>ask Kien</a> for the zip files)</font>")
    document.write("</table></form>")
    document.close()
    if(document.layers) document.captureEvents(Event.KEYPRESS);
    document.onkeypress=GetKey
    function GetKey(e){
    ok=0
    if(N||S){
    theKey=e.which;
    Akey=String.fromCharCode(theKey)
    }
    if(M){
    theKey=window.event.keyCode;
    Akey=String.fromCharCode(theKey)
    }
    if(theKey<97)theKey+=32
    for(k=0;k<keySet.length;k++){
    if(keySet[k]==theKey)return false
    }
    keySet[test]=theKey
    test++
    for(x=0;x<theWord.length;x++){
    if(cor[x]==1)x++
    if(theWord.charCodeAt(x)==theKey){ok=1;document.forms[0].elements[x].value=theWord.charAt(x);cor[x]=1;correct++}
    }
    if(ok==0){
    hang++
    ShowHide("div"+(hang-1),1)
    UsedKeys+=Akey+", "
    if(hang>9)Lose()
    }
    if(correct>=theWord.length)Win()
    }
    function Win(){
    alert("Great job! You Win!\nClick OK to start new game.\n\nWrong letters: "+UsedKeys)
    document.forms[0].reset()
    location.reload()
    }
    function Lose(){
    alert("Sorry! You Lose!\n\nThe word is * "+theWord+" *\n\nClick OK to start new game.\n\nWrong letters: "+UsedKeys)
    document.forms[0].reset()
    location.reload()
    }
    </script>
    <body bgcolor=silver></body>
    </html>

  6. #6
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    I assume that the functions are inside laydiv.js.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  7. #7
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090
    Here's the function:
    Code:
    function GetDiv(divId,divY,divX,divW,divH,bCol,visb,zInd){
    bkCol=(bCol!="")?((N)?" bgColor="+bCol:";background:"+bCol):""
    
    Styl = (M||S) ? "<DIV" : "<LAYER"
    
    if(M||S){
    Styl+=" ID="+divId
    Styl+=" style='position:absolute;top:"+divY+";left:"+divX+";width:"+divW+";height:"+divH+bkCol
    Styl+=";visibility:"+Vis[visb]+";z-index:"+zInd
    Styl+="'>"
    }
    basically that function makes code to start off a DIV.

    All the functions used are here
    Have I helped you? Please Rate my posts.

Posting Permissions

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



Click Here to Expand Forum to Full Width