Jump to content

raimo

Members
  • Posts

    132
  • Joined

  • Last visited

Posts posted by raimo

  1. Success Fixed it.God the wonders of googling, just found out that if you place the inputs inside a div they will validate.Why I dont know, could be a quirk in the validator perhaps when working with XHTML 1.1?Would anyone know.
    The reason is input is NOT valid child element of form in XHTML 1.1But input IS valid child element of div.Check valid child elements of form element:http://learningforlife.fsu.edu/webmaster/r.../forms/form.cfmNo input there.And then check valid child elements of div element:http://learningforlife.fsu.edu/webmaster/r...gs/text/div.cfmYes, there is input.
  2. To know how many checkbox there are in my array of checkbox, I use :var c = document.AlterarExcluirForm.checkbox;var tam = c.length;But, my array is dynamic, and when I have just one checkbox in the array, the command c.length doesn´t works.How can I resolve that ?Thanks.

    To know how many checkboxes You have You shoud do something like:
    <form id="AlterarExcluirForm" action="#"><input type="checkbox" /><input type="checkbox" /><input type="checkbox" /></form><script type="text/javascript">var cnt = 0;var inp = document.getElementById("AlterarExcluirForm").elements; // all inputsfor (var i = 0; i < inp.length; i++) if (inp[i].getAttribute("type") == "checkbox") cnt++;alert(cnt); //there is 3 checkboxes now</script>

  3. GreetingsI've been fussing and researching this all night.  What is the syntax for including a variable (sFrameName) in the following:
     var oDiv = top.+sFrameName+.getElementById('divXX');

    Thanks

    Without knowing what sFrameName is in Your case, I think:
    var oDiv = top.sFrameName.document.getElementById('divXX');

    but can't be sure without seeing more code. if sFrameName is parent window try:

    var oDiv = window.opener.document.getElementById('divXX');

    Anyway, it must allways be document.getElementById

  4. What's wrong with php syntax?  I find it very similar to JavaScript and c++ so it came naturally. :)

    I don't like it that's the reason I'm not using it. By the way, Perl is very similar to C++, borned from it.PHP is borned from Perl actually :)http://fi2.php.net/historyPerl is part of Linux-OS so I can build programs with it, or what ever needed to www-pages. PHP has some good things, but Perl is filled with beuatiful stuff. :)
  5. I have a CSS menu that uses background images instead of just colors.  In FF it works just fine, but in IE there is a hesitation once the mouse rolls over the link.  And when you are navigating the sub menus, the parent menu image changes every time you roll over a sub menu link.  Is there a way around this problem in IE?  Here's a link to the site so you can see what I mean.

    There is STILL 2 head sections in Your page! Days are gone, and otherone is still there.If You wonder why it wont work as it should work You should first fix that thing, in my opinnion... :) If You include with PHP, don't include that other head part (or other harmful things), only part of text or code needed.1st. advice: if there is something seeing "wrong way" anytime with some browser check Your code is in good condition, now it is not.
  6. thirdly, here is very simple but good script to do it :)

    var elms = document.getElementsByTagName('a'); for (var i = 0; i < elms.length; i++){  elms[i].target = elms[i].getAttribute('rel'); }

    Save code to external javascript file (name as target.js or something) and include that JS-file just before </body> tag. (after last a-element of Your document).Include tag:<script src="target.js" type="text/javascript"></script>modify Your links like:<a rel="_blank" href="http://www.google.ru">Google</a>and Your links will open in new window. (rel = target)

  7. It's not part of the W3C DOM, but i'd say it's the best supported and yes the most preferred way of text change.

    I think it depends of what we need to get changed, only value of one text node or array of html tags.innerHTML is very good if there is many tags or should I say nodes. But if only need is change text value of one element DOM is not bad at all.innerHTML:
    document.getElementById('id').innerHTML = 'gerbils are not rats!';

    DOM:

    document.getElementById('id').firstChild.nodeValue = 'me tarzan you jane?';

    OK, with DOM firstChild must exists, innerHTML wrotes is there nodes inside of element or not,but that is not a big problem, I think.

  8. I'm not sure if I'm completely understanding you however when you are setting percentages you can't also specify a pixel amount. You would position it and then set the height to something like 75% and it would resize the height when you changed the height of the page, but you can't ever make it look exactly how you want because the size will be unique based off of how big each person sets their browser window. If you want them to enter your site and have it look a certain way you can change the size of their browser window and then they can resize it if they want and the percentages will take over.

    Look CSS max-width, min-width, max-height and min-height.I'd just tested those yesterday with Opera 9 (and Firefox 1.5.0.2) .. works fine with both.edit:
    <style type="text/css">#ifr1{width: 100%;height: 50%;max-width: 800px;min-width: 500px;min-height: 150px;}</style><iframe id="ifr1"></iframe>

    iframe is "scaling" to 100% only if width of it is between 500px and 800px.And height will stay in 50% until 150px height limit comes, that point it will stop scaling. Cool, I think? :) (but quessing here .. it won't work with MSIE?)

  9. you don't need to use the hex identifier (#) in making your statement:<span style="color:c0c0c0"><p>test</p></span>will get you where you want to go.

    Where You get that? Hex idtenfier MUST be there! It does not mean if it works with MSIE without that identifier, it can be throwed out of the code! :) Test it by pushing hereInvalid number : color c0c0c0 is not a color value : c0c0c0If HEX colors are used there MUST be always # -mark with value.
  10. I'm currently working with forms and want to add a 'browse' button to upload a file from your (local) harddisk. I've used the <input type=file> option but that way I can't change the caption on the button. The thing I want to do is create a custom 'browse' button from which I can edit the caption and after clicking opens a similar dialog to the one from <input type=file>. How can I do this?

    You can do it only by hide original file-input field and then create visible "fake input field" with text input and button or image.Look: http://www.quirksmode.org/dom/inputfile.html
  11. Thanks in advance,Frosty.

    Your welcome! I think this will open Your eyes? :) I'd change spans to better tags.By the way in HTML we are using basicly "big quotes" in attributes, not those small ' 'updots' or whatever they are called in english..
    <div class="section_2"><!-- Sidebar --><div class="section_2a"><p class="sidebarlink"><a href="link.htm" class="sidebarlinkanchor">Clan Art</a></p><p class="sidebarlink"><a href="link.htm" class="sidebarlinkanchor">FrostbiteXIII Art</a></p><p class="sidebarlink"><a href="link.htm" class="sidebarlinkanchor">Barcodes</a></p><p class="sidebarlink"><a href="link.htm" class="sidebarlinkanchor">Super Yous</a></p><p class="sidebarlink"><a href="link.htm" class="sidebarlinkanchor">Lightning Sigs</a></p><p class="sidebarlink"><a href="link.htm" class="sidebarlinkanchor">Custom Art</a></p></div><!-- Main --><div class="section_2b"><h2>Main Section</h2><p>This is the main section</p></div></div>

    Set section_2a width to needed menu width in CSSin CSS file:line 23vertical-align: center;vertical align can't be center, but it can be middle. look: http://www.w3.org/TR/REC-CSS2/visudet.html...-vertical-alignedit:RahXephon IS still faster than I! :)

  12. well, I guess it's cause I'm using a older version of opera.Version: 8.52  Build: 7721  Platform: Win32  System: Windows XPI know it's not a padding or margin problem, I just can't get the right cell tovertically align to the top.I already tried that. Infact, that's is the way I have it right now... but it's still not working.This is how I see things in Opera (just a piece of the page), the Contents on the rightsite are suppose to be aligned to the top:http://i7.photobucket.com/albums/y268/HYPNOTOAD000/img13.jpg

    Very strange, but 8.52 is quite old (February 17, 2006).You can install any count of Operas (different versions), just install each to own directory. I mean if You need to test is it fixed in newer Opera.Here is a shot how Opera 9 is seeing Your page:http://raimo.atspace.org/rahxephon.htmlAll looks good, I think?Different Opera versions can be found:http://snapshot.opera.com/windows/edit:aaarggh! fixed link :)
  13. I only see one head section, can you point it out to me?The problem in IE is the delay on mouseover and mouseout.  There doesn't seem to be this problem in FF.

    1st one is begin of the document, and the 2nd is inside of nav div:
    	<div class="content">  <div class="nav">  	<!DOCTYPE htmlPUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html><head><title>Navigation Menu</title><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><meta name="description" content="" /><meta name="author" content="Mike Saylor" /><!-- Last updated 4/10/2006  --></head><body>	<div id="menu">  <ul>  	<li><h2>Home</h2>

    edit: I can't test it with IE I'm living in Linux, I have no IE at all, luckily. :)But for(i = 0; i < p; i++){ should be: for(var i = 0; i < p; i++){No other JS errors found. But I think, the 2nd head part can get IE a bit confused.

  14. ok, heres my next question, how do I change the color of the text in the box that comes up? I need to be able to keep the middle text white, but change parts of it to multiple other colors. What do I need to do to change that?Thanks :)

    You just added style block to the head part of Your document.Now, add to that block more classes:
    .red{color: red;background-color: inherit;}.blue{color: #0000FF;background-color: inherit;}.bold{font-weight: bold;}

    And then in body part, where ever You need color (or other style):Some text <span class="red">this is red</span><span class="blue>this is blue</span> and again, original colorized text. <span class="bold">this is bold</span>Can be used with all tags.Look more:http://www.w3schools.com/css/

  15. no, the function receives 3 parameters: 1) this 2) event 3) the menu nameas i said, it works when outside the setTimeout procedure.and just to make sure  i tested your suggestion, didn't work :)

    Sorry! :)I think setTimeout is just OK now, but move it inside of Your function,and call function straight with onmouseover.
  16. Can someone please explain to me whats different? what it means? and how can I use similar coding to get the same "popup" effect?thanks so much

    They are calling different kind of functions. thats the difference, I think.Lets do the same as they have done, but we do it better, faster and cleaner! :) Add this to head part of Your document:
    <script type="text/javascript"><!--function showLayer(e, obj){var x = (e.clientX) ? e.clientX : window.event.clientX;var y = (e.clientY) ? e.clientY : window.event.clientY;var elm = document.getElementById(obj);elm.style.left = x + 10 + 'px';elm.style.top = y + 'px';elm.style.display = 'block';}function hideLayer(obj){var elm = document.getElementById(obj);elm.style.display = 'none';}//--></script><style type="text/css"><!--.hidden{position: absolute;width: 250px;display: none;border: solid 2px #FF6060;background-color: #600000;color: #F0D0D0;}--></style>

    And this to the body part:

    <div id="layer1" class="hidden">This is the first hidden div.<br />Add something nice here.</div><div id="layer2" class="hidden">This is the second on</div><p onmouseover="showLayer(event, 'layer1')" onmouseout="hideLayer('layer1')">Move mouse here</p><p onmouseover="showLayer(event, 'layer2')" onmouseout="hideLayer('layer2')">Move mouse here</p>

    So we have 2 hidden divs (display none) and when mouse is lurking over p tag display attribute is changed to block and selected div appears to visible. When the mouse goes out of p-tag, display will be setted as none again. Mouse position is looked from event and div is moved near mouse before showing. Try that, and please feel free ask more if needed.

  17. float: left;to Your CSS file or CSS block in head part:

    .left{float: left;}.right{float: right;}

    and body:

    <div class="searchbox"><div class="left">By Productsearch <select name="Searchbyproduct" onchange="MM_jumpMenu('parent', this, 0)">   <option>Router</option>   <option>Server</option>   <option>Switch</option>   <option>Network</option>   <option>Backups</option> </select></div><div class="right"> <select name="Bymanuf" onchange="MM_jumpMenu('parent', this, 0)">   <option>HP</option>   <option>Cisco</option>   <option>Brocade</option>   <option>Sun</option>   <option>More...</option> </select></div></div>

    You can remove those forms if You are not sending with them.

×
×
  • Create New...