Jump to content

Jonas

Members
  • Posts

    2,402
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Jonas

  1. Ok, just so you know, it's not a good idea to start off with php. You should definetely start off with (x)html, then perhaps css, javascript and php/mysql. If you're wondering about anything, don't hesitate to ask. That's what this forum is about.
  2. You're gonna hate me for saying this, but it works fine in Opera...
  3. http://www.w3schools.com/css/css_pseudo_elements.asp1. If you read at the bottom of the link, you'll see that IE (5 at least) does not have support for :before and :after pseudo-elements...
  4. No no no...Um, no, yeah, I guess you're right...
  5. No, I think he means that he wants a comment form, not a forUm, for his site. What people think about the site should be emailed to him...
  6. Correct. Or you could use R(ed)G(reen)B(lue) or #HEXinput.operator:active {background-color: RGB(255,0,0);background-color: #ff0000;background-color: red;}oh, and remember to assign the necessary class to the <input> elements...<input class="operator" value="+" etc. />
  7. Ok, so you want just the operators? That's simple. Just put classes on the <input>s that are for operators.input.operator:active {some css: here;}In case you didn't know... :)You can of course change the styling of the buttons too, like the borders, but I think it looks fairly nice...
  8. Jonas

    Question

    I know it's possible with Javascript, because I did it once on my old site, which I lost. It was my first site, and made with frames, and I didn't back it up, because it wasn't any good. But the script was excellent... :(I got an A at the time, because it was a project in Computers course. Perhaps my teacher from last year still has the page, because I think I gave her a cd. I'll ask her on monday...
  9. Jonas

    help with iframe

    With html --> <iframe src="your_site.html" width="?px" height="?px" /> With html and css --> <head><style type="text/css"><!--iframe {width: ?px;height: ?px;}--></style></head><body><iframe src="your_site.html" /></body>
  10. <head><title>Calculator</title><style type="text/css"><!--form {width: 150px;border: outset 3px #000000;}input {width: 30px;background-color: #dedede;color: #000000;border: double #0000ff 3px;}input:active {background-color: #ff0000;}input.window {width: 132px;background-color: #ffffff;color: #000000;}input.sum {width: 132px;}--></style><script type="text/javascript">function foc(){zah()document.forms.myForm[0].focus()}function numberletter(){ z = "0"while (z == "0"){ x = document.forms.myForm[0].value y = x.length if(y == 0) { return } for(i = 0;i<y;i++) { z = "0" for(j=0;j<10;j++) { if(x.substring(i,i+1)==j) { z="1" } } if(z=="0") { if(i==0) { document.forms.myForm[0].value=x.substring(1,y) } else { document.forms.myForm[0].value=x.substring(0,i)+x.substring(i+1,y) } i=99 } }}}function operator(operator){document.forms.myForm[17].value=operatordocument.forms.myForm[18].value=document.forms.myForm[0].valuedocument.forms.myForm[0].value=""}function alrt(){alert("BKAH")}function calculate(first,second,operator){if (first.length==0){ alert("Please enter 2 numbers and an operator before calculating."); zah() return}if (second.length==0){ alert("Please enter 2 numbers and an operator before calculating."); return} if (operator.length==0){ alert("Please enter 2 numbers and an operator before calculating."); return}if (operator=='+'){ var y=eval(first)+eval(second) document.forms.myForm[0].value=y}if (operator=='-'){ var y=eval(first)-eval(second) document.forms.myForm[0].value=y}if (operator=='*'){ var y=eval(first)*eval(second) document.forms.myForm[0].value=y}if (operator=='/'){ var y=eval(first)/eval(second) document.forms.myForm[0].value=y}}function clrlast(){var v = document.forms.myForm[0].valuevar l = v.lengthif(l > 0){ var b = v.substring(0,l-1) document.forms.myForm[0].value=b}}function zah(){document.forms.myForm[0].value=""document.forms.myForm[18].value=""document.forms.myForm[17].value=""}function called(num) //start function that recieves button clicks{var blah=document.forms.myForm[0].valuelength = blah.length //put the length of the text box into "length"if(!(num=='0' && length==0)) //checking if the first digit in the box is not 0{ x=document.forms.myForm[0].value y=x+num document.forms.myForm[0].value=y}num="" //undefine variableslength="" //""document.forms.myForm[21].value=blah}</script></head><body onload="foc()"><fieldset><form name="myForm"><center><table><tr><td colspan="4"><input class="window" type="text" dir="rtl" value="1" onchange="numberletter()"></td></tr><tr><td><input type="button" value="7" onclick="called('7')"></td><td><input type="button" value="8" onclick="called('8')"></td><td><input type="button" value="9" onclick="called('9')"></td><td><input type="button" value="+" onclick="operator('+')"></td></tr><tr><td><input type="button" value="4" onclick="called('4')"></td><td><input type="button" value="5" onclick="called('5')"></td><td><input type="button" value="6" onclick="called('6')"></td><td><input type="button" value="-" onclick="operator('-')"></td></tr><tr><td><input type="button" value="1" onclick="called('1')"></td><td><input type="button" value="2" onclick="called('2')"></td> <td><input type="button" value="3" onclick="called('3')"></td><td><input type="button" value="*" onclick="operator('*')"></td></tr><tr><td><input type="button" value="0" onclick="called('0')"></td><td><input type="button" value="C" onclick="clrlast()"></td><td><input type="button" value="CA" onclick="zah()"></td><td><input type="button" value="/" onclick="operator('/')"></td></tr><tr><td colspan="2"><input type="hidden" value=""></td><td colspan="2"><input type="hidden" value=""></td></tr><tr><td colspan="4"><input class="sum" type="button" value=" = " onclick="calculate(document.forms.myForm[18].value,document.forms.myForm[0].value,document.forms.myForm[17].value)"></td></tr></table></center></form></fieldset></body> Ok, so there's the code with tables... Also added some css to make the window and sum buttons wide enough...
  11. http://www.w3schools.com/js/tryit.asp?file...om_event_buttonApparently, it only works in Opera... :)But, since onfocus and onblur didn't work, I tried the css suffix :active, and that worked...input:active {background-color: #ff0000;}
  12. Jonas

    Protecting CSS files

    I suppose. But it's through other people's code that you learn stuff. I for one have learned a lot by looking at other people's html and css. My own pride keeps me from just stealing another website, but I guess that doesn't apply to everyone...
  13. You want them to open something from your hard-drive?
  14. If you give us a sample of the code to work with, that would help...
  15. Jonas

    Protecting CSS files

    And, if you want to, you can even put the javascript code in an external file, and hide that too...
  16. You can try something like this: <html><head><style type="text/css">input {color: #000; background-color: #ccc;}</style></head><body><input type="button" value="1" onfocus="this.style='background-color: #ddff33; color: #ff0000; border: outset #000000 2px;'" onblur="this.style=''"></body></html> Heh, you may not want my colors though...
  17. Jonas

    Protecting CSS files

    Interesting concept... :)But I'd use:w=sx=cy=rz=iptso you can write "src" with "w"+"y"+"x"<wxyz wyx="something.xww" />
  18. Jonas

    Tryit editor

    http://javascript.internet.com/forms/html-preview.htmlThere's a useful one...Of course, to make it valid html, you should use<script type="text/javascript">Oh, and quote attributes like cols="" rows=""... :)I had a script earlier which showed the result in an iframe on my webpage right next to the textbox, but I lost my webpage (abandoned it really) when my host deleted me because of little to no activity... Never thought I'd be wanting that site (code) back... :|
  19. Yeah, I've had this same problem myself earlier, and didn't know any php. I still don't know much really. I just made a javascript that redirected me.Choose a theme! <p> <object> <form name="form" action=""> <select name="site"> <option class="choose" value="">Choose theme...</option> <option value="<!--www.yourdomain.com-->/index.html">Blue</option> <!-- Default page and theme --> <option value="<!--http://www.yourdomain.com-->/green/index.html">Green</option> <!-- Green page --> <option value="<!--http://www.yourdomain.com-->/orange/index.html">Orange</option> <!-- Orange page --> <option value="<!--http://www.yourdomain.com-->/red/index.htm">Red</option> <!-- Red page --> </select> <br /><br /> <input type="button" value="Change theme!" onclick="javascript:formHandler(this)" /> </form> </object> </p> Of course, duplicating every document for three or four colors is not very practical for a large page...
  20. Jonas

    Protecting CSS files

    Why would you want to protect your css files?
  21. Is there such a thing? I thought 1.1 was only Strict... Also, I don't think marquee is valid in any way...
  22. something along the lines of Mozilla FireFoxOr better yet, Opera... Opera has the best css support, and also html I should think...
  23. Jonas

    php include

    Ah, it does... :)So if I wanted to make an external menu, I would make an inc file with code for just the menu, not the <html><head>...</head><body>... etc.? Just for example <div>Menu: <a>1</a><a>2</a></div> ?
  24. Jonas

    Vertical Centering

    Could one use <div><span></span></div> as opposed to <div><div></div></div> ?Would make it easier to write into the right tag...
×
×
  • Create New...