Jump to content


  • Posts

  • Joined

  • Last visited

About george

  • Birthday 08/24/1955

Contact Methods

  • Website URL
  • ICQ

Profile Information

  • Location
    Stone throw from the US capitol

george's Achievements


Member (2/7)



  1. I have been trying to create a page with a color gradient background using CSS: body { background-image:-moz-linear-gradient(top, #000029 50%, #000080 100%); } But when I render the page, the gradient extends only as far as the content, and then repeats to fill the screen. How can I make it so that it renders the gradient to the full browser window, regardless of the content? When I replace the body background-image attribute with a background-color attribute, it renders to the full screen, as I would expect. Perhaps this can not be done, or maybe there is a workaround?
  2. The reason it is complicated to position text using CSS is because there is a range of browsers and screen resolutions which the code may be rendered on. So the code must be written in such a way as to address all of these possibilities. In your example, centering a block vertically can only be done when you have a fixed screen height of some known value. But since one can generally scroll down a page as long as there is something to display, there is no known bottom. What I would do is provide a margin-top:20px; attribute to your body tag, or, if your text is contained in a DIV tag, provide that div tag with a margin-top value.
  3. Within script tags in the body of my HTML, I have: aRay = new Array(); aRay[0] = 'a'; aRay[1] = 'b'; aRay[2] = 'c'; aRay[3] = 'd'; aRay[4] = 'e'; document.write("aRay length is "+aRay.length+"</br>"); for( i = 0; i < aRay.length; i++ ) document.write("element "+i+" is "+aRay[i]+"</br>"); for( y = 0; y < aRay.length; y++ ) { if(aRay[y]='d') document.write("so we can find ""+aRay[y]+"" in element "+y+"</br>"); break; endif; } And what prints out is: aRay length is 5 element 0 is a element 1 is b element 2 is c element 3 is d element 4 is e so we can find "d" in element 0 That 0 at the end of the line above should be a 3. Why isn't it? What am I missing here?
  4. That was it dsonesuk. I only want to display the built string because I want to see if I made any mistakes, and sure enough, I did.
  5. Thanks dsonesuk, I will try that now.
  6. Since the content of the variable I want to echo is HTML code, maybe there is some way I need to escape it, or echo it to a variable, and then populate an innerHTML with it? I do not want the HTML I am outputting to be used by the browser as HTML on the fly. I want to display the HTML as content.
  7. Here is my code: The code fails at line 36: $txt = substr($mtcontent, 0, strpos($mtcontent, "</title>")+7); <!DOCTYPE HTML><html><head> <meta charset="utf-8"> <title>Untitled Document</title> <style type="text/css"> body { margin:20px; padding:0; background-color:#0000FF; color:#FFFF00; } </style></head><body><h3>/* make a copy of the file to parse for assurance */</h3><br><?php copy("C:UsersownerDesktopPLUcodes.htm", "C:UsersownerDesktopworkfile.htm"); if(!file_exists("C:UsersownerDesktopworkfile.htm")) { die("File not found"); } else { echo "got copy"; }?><br><h3>/* get a file handel for the workfile */</h3><br><?php $myfile = fopen("C:UsersownerDesktopworkfile.htm", "r") or die("Unable to open file!");?><h3>/* copy content of workfile into a var, $mtcontent, for parsing */</h3><br><?php $mtcontent = fread($myfile,filesize("C:UsersownerDesktopworkfile.htm"));?><h3>/* we don't need the file workfile.htm open anymore, so close it using the file handel for that file */</h3><br><?php fclose($myfile);?><h3>/* get the content of our string from the first byte up to the closing title tag */</h3><br><h3>/* well put it in a varable called $txt */</h3><br><?php $txt = substr($mtcontent, 0, strpos($mtcontent, "</title>")+7); echo $txt;?><h3>/* then add the string litteral <head><body> to the end of our string */</h3><br><h3>/* have to use the HTML code for the grater and less than symbols, else won't work */</h3><br><?php $txt .= '<head><body>'?><h3>/* lets see what we have */<h3><br><?php echo $txt;?></body></html> I have tried using strpos($mtcontent, "<‚ĀĄtitle>") instead of strpos($mtcontent, "</title>") But that causes the page to render strangely wrong. At the end of the page, I want to echo the variable txt, but it appears to be empty.
  8. Problem fixed, as I did change it to <div ="t1"><pre>.t1 { border-color: blue red green yellow; border-style:solid;}</pre></div> and that did correct my problem.
  9. I have a very simple jQuery line of code that is not working. $("p#t1").css("color","#ffffff"); In my document I have a P tag with an ID of t1. I have attached my entire HTML file should this be helpful. TIA My ID of t1 is not declared in my CSS. Could this be the problem? I am going to declare it now. triangle.html
  10. I have tried chaining a .stop(), a stopPropagation(), and a stopImmediatePropagation() to the end of the in-document code as follows $("a.imp").click(function(){$(this).parents("div").css('z-index','2')}).stopPropagation(); ; None of them stopped the repeating of the animation, which I want to run only on document ready.
  11. I have a page with some jQuery on it. In the header, I have <script src="../js/jquery-1.9.1.min.js" type="text/javascript"></script><script> $(document).ready(function(e) { $("div.box").each(function ( i) { var div = $(this); setTimeout(function () { div.fadeIn(800); }, i * 800) }); });</script> And within the document body itself I have <script> $("a.imp").click(function(){$(this).parents("div").css('z-index','2')}); </script> Both functions do as I want, but the script that is within the document presents it's result real briefly, and then the automation generated in the header section runs again. How can I make it stop? I want one thing to run on document load, and the other thing to run when the client clicks an anchor tag. But they both run when I click the anchor tag.
  12. I am attempting to fade in 8 images, one at a time with a delay between each one. I have used the following code. /* I have 8 <div>s, named "one", "two", "tre" ... etc.. */ var divs = ["one", "two", "tre", "for", "fiv", "six", "svn", "egt"];/* initially these divs all have an attribute of display:none I step through each elemet in the "divs" array, I take the litteral "div#, and append to it the value of the current array element, and pass this value to the slowShow function. */ for (var i=0;i<divs.length;i++) { setTimeout(slowShow("div#"+divs[i]), 555555); }; /* the function slowShow calls a jQuery function using the value passed to that function as the selector for the jQuery function */ function slowShow(param) { $(param).fadeIn( 2400 ); };/* the snipit of code displays the 8 individual divs all at once, though they all use the fadeIn value of 2400 */ The entire page code is attached, but the images are not. Please note, Initially a class was used to give all divs the attribute of display:none. All divs had that class, plus a unique identifier. I was hoping that by using the ID as the jQuery selector, I might be able to display each div individually, one by one. But they all display at once, as though I was using the class in my selector. I already tried placing a display:none attribute in each unique div identifier. That didn't help, so I changed it back to using a class to set all the divs to display:none.
  13. I have eight instances where I adjust the CSS using jQuery. Six of them work just fine. Two of them don't work at all. Lines 151 and 159 do not alter the CSS as they are suppose to. Looking at the file, I process all eight triangles using the same syntax. Hovering over a triangle hilights that triangle, and highlihghts the syntax that builds it. The top-left and the bottom-right triangles do not change color on hover. The other six triangles and corresponding text highlight just fine. Here is link to the site. I have also attached a copy. So far, I have attempted changing the id of the particular element to another name, thinking it may be a reserved word problem. I have also combed the code for syntax errors, but have not found any. I am using jquery-1.8.3.min.js . Please help.
  • Create New...