Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by Ingolme

  1. In order to make it have a scroll bar on overflow you'll need to modify this line:<td height="289" align="center" class="style1">And make it look like this:<td class="style1">And then change the CSS :(by the way, I recommend an alternate font, my computer doesn't have "Batik Regular" and is using Times New Roman).style1 {font-family: "Batik Regular",Arial;height: 289px;text-align: center;}On another subject... tables aren't the professional way to define a layout.
  2. If it's the same database you only need to write the connection script and database selection script once. Just put it in the beginning of the page once and that's it.
  3. Hello, I didn't think I'd be asking for much help here, but I've encountered a problem which I can not solve.I want to embed MIDI files to my site, but they aren't working. I made a code that works at least in Firefox, Opera, Internet Explorer 6 and Internet Explorer 7 on Windows XP.However, a friend of mine using Vista can not see the MIDI file. Apparently, Vista simply won't play embedded MIDI files with the Windows Media Player plug-in. For a few months I solved it using the Quicktime plugin by changing the classid attribute. But some Windows update or something has caused a problem and the
  4. Try this_onchange="setAmount(this.value)"
  5. I assign the link L[i ] to the variable obj so that I can reference it in the rest of the script. If I didn't do that [b]i[/b] would change and I couldn't reference that object anymore with L[ i].EDIT:the variable i should increase with each link there is on the page while it's searching for the one that contains the current page location.
  6. I didn't think it mattered, but just in case, I recommend setting the style individually:function effect() {document.getElementById("text").style.color = "rgb(" + r + "," + g + "," + b + ")"document.getElementById("text").style.cursor ="pointer";}function eraser() {document.getElementById("text").style.color="#000000";//put the default color of the page's text.}
  7. r, g and b are not global variables, so this script is going to do nothing.But if they were this is what your script would do:When you pass the mouse over "text" it will take a random color.In order to make the script do something, try this: var r = 255;var g = 0;var b = 0;speed = 50; //millisecondsfunction colors() { if( r==255 && g< 255 && b==0 ) { g+=5; setTimeOut( "colors()", time ) }; //add green if( r> 0 && g==255 && b==0 ) { r-=5; setTimeOut( "colors()", time ) }; //reduce red if( r==0 && g==255 && b< 255 ) { b+=5; setTimeOut( "c
  8. You don't seem to be calling the function effect() at all.And the variable text isn't defined in the lines with document.getElementById(text)Maybe you mean document.getElementById("text")
  9. Ingolme

    Simple Error

    Yes, somewhere or another you must have added at least one extra }
  10. But there's nor specification that it's actually checking Boolean. In PHP it would work, but it doesn't in Javascript.Try this: function validate() { var valid = true; valid &= checkName(); valid &= checkPhone(); valid &= checkOtherThingsElse(); if(valid == 0) return false; return true;}
  11. Hmm, I told it to seach the links for the path of the current pageGiven the url "http://www.domain.com/folder/file.html"location.pathname returns the string "/folder/file.html".Translation to english of this line if(L[i].href.indexOf(location.pathname) != -1) If the position of location.pathname in the HREF of this <a> tag is not -1 (indexOf returns -1 if the string isn't found)---If you want to get the filename and not the full path you'll need to extract it from the path, here's my method: pos = location.pathname.lastIndexOf("/");str = location.pathname.substr(pos+1);if(L[i].href.in
  12. Ingolme

    Mozilla FireFox

    I really don't recommend that. It's annoying and a pretty big mistake from web designers.Some people may be in offices or shared computers and aren't allowed to download other software.I guess you can detect the browser using $_SERVER['USER_AGENT'] (I think that's the variable, somebody correct me if I'm wrong.
  13. I usually avoid working with margins and padding in inline elements.You can use margin-left, margin-right, margin-top and margin-bottom. Or all of them at once like this:margin: 10px 5px 5px 2px;margin: top right bottom left;
  14. Why not return "false"? Zero (0) is number data.
  15. With CSS you can to everything. You use the style attribute to add CSS.For example:<img src="something" alt="alternate text" style="display: block; margin: 20px;" />
  16. <body style="text-align: center"><div style="margin: 0 auto; width: 650px;">Content</div></body>
  17. Ingolme

    Form layout

    No, you're using the table to locate the form elements into the page, therefore you're using it for layout purposes.Tabular data is data that can not be displayed in any other way than a table, it's data like what I showed before, that has various different fields. It can be experiment results, weather information, sports event timing... etc.
  18. I guess you should make the fields "NOT NULL" when you create the database table.
  19. Ingolme

    combo box

    while ($row = mysql_fetch_array($result)) { echo '<option value="'.$row['ID'].'">"'.$row['Term'].'"</option>\n'; }
  20. Is it really possible that the event is not recognised?
  21. Ingolme

    Form layout

    But tables aren't for that type of data.Tables are for tabular data, not just any data. You're using that table for layout purposes.This is the way tables are meant to be used: | Wind speed | Wind direction | Temperature | Humidity |--------------------------------------------------------| 12 km/h | NE | 25ºC | 65% |--------------------------------------------------------| 14 km/h | N | 23ºC | 66% |--------------------------------------------------------| 15 km/h | NE | 22ºC | 59% |--------------------------------------------------------
  22. You can try this: var obj;var i;var L = document.getElementsByTagName("a");//Step 1: get the link in questionfor(i=0;i<L.length;i++) { if(L[i].href.indexOf(location.pathname) != -1) { obj = L[i]; }}//Step 2: Obtain data from the linkvar Ldata = obj.firstChild.nodeValue; //obtains text from the first child//Step 3: Create the <strong> elementS = document.createElement("strong");T = document.createTextNode(Ldata);S.appendChild(T);//Step 4: Insert it into the correct location;obj.parentNode.insertBefore(S,obj);//Step 5: Delete the <a> elementobj.parentNode.removeChild(obj);
  23. Lots of browsers don't allow you to change the status bar information so that people can know where links are going.
  24. Ingolme

    Basic Flash Player

    Learn ActionScript first, and think about this after you know a certain amount. I'm afraid I can't give a source to an ActionScript tutorial, my knowledge comes from a big variety of places.
  25. function showDetails(e) {// This defines the element that fired the event_obj = (e.srcElement)?e.srcElement:e.target;// Do something with _obj}
  • Create New...