Jump to content

AARRGGHHH

Members
  • Content count

    35
  • Joined

  • Last visited

Community Reputation

0 Neutral

About AARRGGHHH

  • Rank
    Newbie

Recent Profile Visitors

743 profile views
  1. AARRGGHHH

    Strange Footer Issue

    Amazing, that fixed it. Thank you very much, Ingolme.
  2. AARRGGHHH

    Strange Footer Issue

    I'm having a <footer> issue that I cannot figure out. The footer displays exactly as expected on my desktop at several different resolutions. On my iPhone, sometimes the footer displays normally, and sometimes it displays at a font size of 100% (it should be quite a bit smaller). The part that's confusing me is that all of the pages us identical HTML and CSS code: HTML: </main> <footer> <script>footer()</script> <!-- footer() is in an external .js page so all pages read the same footer() --> </footer> </body> </html> CSS: html { background-color:#000000; width:100%; margin-left:auto; margin-right:auto; } header { background-color:#000000; width:100%; max-width:1024px; margin-left:auto; margin-right:auto; } body { background-color:#000000; width:100%; max-width:1024px; margin-left:auto; margin-right:auto; } nav { background-color:#000000; width:100%; max-width:1024px; margin-left:8px; margin-right:auto; } main { background-color:#000000; width:100%; max-width:1024px; margin-left:auto; margin-right:auto; /* float:right; */ } h1, h2, h3, h4, h5, h6 { font-family:calibri,verdana,arial,sans-serif; color:#938FEB; text-align:center; margin-left:auto; margin-right:auto; } p, form, ul, td { font-family:calibri,verdana,arial,sans-serif; color:#FFFFFF; /* text-align:left; */ } li { font-family:calibri,verdana,arial,sans-serif; color:#FFFFFF; text-align:left; font-weight:bold; } div { font-family:calibri,verdana,arial,sans-serif; color:#FFFFFF; text-align:center; } span { font-family:calibri,verdana,arial,sans-serif; color:#FF0000; text-align:center; } footer { background-color:#000000; width:100%; max-width:1024px; bottom:0; /* float:right; */ /* position:fixed; */ margin-left:auto; margin-right:auto; font-size:10px; font-family:calibri,verdana,arial,sans-serif; color:#FFFFFF; text-align:center; } #wrapper { width:100%; } button { background-color:#8000FF; border:none; border-radius:12px; color:white; padding:12px 24px; text-align:center; text-decoration:none; display:inline-block; font-family:calibri,verdana,arial,sans-serif; font-size:14px; } button:hover { background-color:#CC0000; box-shadow: 10px 10px 10px RGBA(255,255,255,0.8); } a:link { font-family:calibri,verdana,arial,sans-serif; color:#00CCFF; text-decoration:underline; } a:hover { font-family:calibri,verdana,arial,sans-serif; /* color:#00CCFF; */ color:FF0000; } a:visited { font-family:calibri,verdana,arial,sans-serif; /* color:#800080; */ color:#938FEB; } function footer() { document.getElementsByTagName("footer")[0].innerHTML = '<p>Line 1<br>' + 'Line 2<br>' + 'Line 3<br>' + '©2018 Line 4<br></p>'; } I also tried: function footer() { document.getElementsByTagName("footer")[0].innerHTML = '<div>Line 1<br>' + 'Line 2<br>' + 'Line 3<br>' + '©2018 Line 4<br></div>'; } and tried: function footer() { document.write('<div>Line 1.<br>'); document.write('Line 2<br>'); document.write('Line 3<br>'); document.write('©2018 Line 4<br>'); } Yes, I know, the CSS is politically incorrect because I don't use margin and padding. That does not cause this kind of issue. So, how can the same HTML, CSS, and JavaScript cause different pages to print the footer in different ways on the same iPhone? Thank you very much!
  3. AARRGGHHH

    Making unusual navigation work in all screen dimensions

    I have a lot to read through here, but 1 question comes to mind immediately: If I should not use a fixed width for body, could you supply a code sample of the "wrapper container" you suggested? Thank you
  4. AARRGGHHH

    Making unusual navigation work in all screen dimensions

    No, your original suggestion that the CSS is throwing off the alignment is correct. However, the page looks ridiculous without constraining the width. I tried using % instead of pixels and have the same problem. Is there a workaround for controlling page width which will allow me to use my code, which works perfectly, AND keep width control? The offset of the buttons is the concern. At a width of 1366 and an offset of -340, the buttons don't disappear, they're about 10% visible before they animate (that's exactly what I want). By using screen.width, there should be a way to adjust this offset dynamically, so that it's right for any size display. But I can't figure out the math... Interestingly, 1366 (my screen width) - 1024 (my <body> and <main> width = 342. If I use "left: -342;" the result is perfect. But screen.width - 1024 = leftOffset does not work at higher resolutions. A resolution of 1600 requires "left: -460;" a resolution of 1920 requires "left: -620;". So, I still haven't figured out the math needed to adjust for the <body> and <main> width throwing off my left alignment.
  5. AARRGGHHH

    Making unusual navigation work in all screen dimensions

    Hi Here is the relevant HTML: <div id ="container"> <br><br><br><br> <img src="homeSilverGlassText.png" alt="Home" width="200" height="35" id="bar0" onmouseover="startMove(0)" /> <br><br><br><br> <img src="aboutSilverGlassText.png" alt="Anout Me" width="200" height="35" id="bar1" onmouseover="startMove(1)" /> <br><br><br><br> <img src="contactSilverGlassText.png" alt="Contact Me" width="200" height="35" id="bar2" onmouseover="startMove(2)" /> <br><br><br><br> <img src="gallerySilverGlassText.png" alt="Gallery" width="200" height="35" id="bar3" onmouseover="startMove(3)" /> <br><br><br><br> <img src="uiSilverGlassText.png" alt="Design" width="200" height="35" id="bar4" onmouseover="startMove(4)" /> <br><br><br><br> <img src="imgeditSilverGlassText.png" alt="Editor" width="200" height="35" id="bar5" onmouseover="startMove(5)" /> </div> The container item is only used on this page, not on the entire website, so its CSS is in the <style></style> tags, it did not work on any resolution but mine. If it's possible to avoid absolute positioning here, please tell me how! Your sample menu is doing exactly what it should be doing. You mentioned that the CSS in the <style></style> tags should work regardless of resolution. Do you know why it's not working? Many thanks!
  6. AARRGGHHH

    CSS NOT CHANGING DYNAMICALLY

    dsonesuk, an absolute positioning follow up question: I'm using canvases layered with z-index on a page. And, as you know, everything that occurs after position: absolute; becomes a problem. I'm under the impression absolute is needed when layering canvases, is this correct? Thank you
  7. AARRGGHHH

    Making unusual navigation work in all screen dimensions

    That would be nice!!! The first block of code looks fine at my resolution of 1366. When I switch to my laptop's resolution of 1920, the images disappear (possibly off to the far left). Also, the scrollbar at the bottom of the page extends to the far right, beyond 1920 pixels In case it's useful, here is the page's style sheet: header { background-color:#000000; width:1024px; margin-left:auto; margin-right:auto; } body { background-color:#000000; width:1024px; margin-left:auto; margin-right:auto; } nav { background-color:#000000; width:1024px; margin-left:15px; margin-right:auto; } main { background-color:#000000; width:1024px; margin-left:auto; margin-right:auto; /* float:right; */ } h1, h2, h3, h4, h5, h6 { font-family:calibri,verdana,arial,sans-serif; color:#938FEB; text-align:center; margin-left:auto; margin-right:auto; } p, form, ul, td { font-family:calibri,verdana,arial,sans-serif; color:#FFFFFF; /* text-align:left; */ } li { font-family:calibri,verdana,arial,sans-serif; color:#FFFFFF; text-align:left; font-weight:bold; } div { font-family:calibri,verdana,arial,sans-serif; color:#FFFFFF; text-align:center; } span { font-family:calibri,verdana,arial,sans-serif; color:#FF0000; text-align:center; } footer { background-color:#000000; width:1024px; bottom:0; /* float:right; */ /* position:fixed; */ margin-left:auto; margin-right:auto; } Thank you !!!
  8. I'm using somewhat unusual navigation, as seen here. When a user mouses over the bars, they slide out into view. All of that is working fine. The problem is, I cannot find the CSS to make the buttons align left of the edge of the screen (as seen in the image), regardless of the display dimensions. I originally tried: <style> #container {width: 600px; height: 25px; position: relative;} #bar0, #bar1, #bar2, #bar3, #bar4, #bar5 {position: absolute; left: -340px;}"; </style> Which worked perfectly. But only on my screen. I thought that position:absolute inside position:relative would work regardless of screen dimensions, but I was obviously wrong. I then tried several variations on dynamically adjusting the screen width in the container <div> with a function that runs onload: function populateArrays() { // populate arrays for (i = 0; i <= 5; i++) { position[i] = -340; bar[i] = document.getElementById("bar" + i.toString()); id[i] = i; } // Add a dynamically built style sheet var sheet = document.createElement('style'); var sWidth = screen.width; var lWidth = sWidth - 1024 // 1024px is width of the page body. The result, 342, works perfectly at my resolution of 1366: 1366 - 1024 = 342 (I use -342). sheet.innerHTML = "#container {width: " + sWidth + "px; height: 25px; position: relative;} #bar0, #bar1, #bar2, #bar3, #bar4, #bar5 {position: absolute; left: " + -(lWidth) + "px;}"; document.body.appendChild(sheet); } But this also did not work. Perhaps I should be using a formula other than screen.width - 1024 = -(lWidth)? All I know is it doesn't work at other resolutions. What is the correct way to align the images to the far left, partially (mostly) off screen, regardless of dimensions? I've lost an entire day's work to this. Thank you very much
  9. AARRGGHHH

    Can't Get Canvas To Rotate

    3 minutes ago, Ingolme said: "Just for reference, the rotate command and other transformations need to be called before drawing the image because it doesn't modify the existing content of the canvas, it just changes the frame of reference for the next objects that are going to be drawn.... " lol - GMTA - we posted those replies seconds apart. When I would draw my image before rotating, it never showed up.. The .save and .restore seem to be important to resolve that issue. And it seems translate sets the point where drawing begins (the bottom of an arrow or clock hand, for example). If this does test okay, maybe we should pin it. There's a lot of other people hitting goggle with the same question. Thank you, Ingolme
  10. AARRGGHHH

    Can't Get Canvas To Rotate

    For future reference, since I know others will have this issue, this seems to resolve it: var image = document.getElementById("arrowImage"); var context = arrowCanvas.getContext('2d'); context.save(); context.translate(240, 255); //where to put image context.rotate(-180 * Math.PI / 180); //angle // context.drawImage(image, -image.width / 2, -image.height / 2); context.drawImage(image, 0, 0); //restore the canvas context.restore(); The w3Schools sample code is a bit lacking, since it only covers drawings, not images. Not 100% finished testing yet, but I think it's gonna work.
  11. AARRGGHHH

    Can't Get Canvas To Rotate

    I tried 45 degrees, no luck. I'm certainly open to suggestion! Thank you, Ingolme
  12. AARRGGHHH

    Can't Get Canvas To Rotate

    This seems so simple: var aC = document.getElementById("arrowCanvas"); var context = aC.getContext("2d"); var img = document.getElementById("arrowImage"); context.drawImage(img, 225, 225); context.rotate(90 * Math.PI / 180); But the canvas never rotates. Also tried: var aC = document.getElementById("arrowCanvas"); var context = aC.getContext("2d"); var img = document.getElementById("arrowImage"); context.rotate(90 * Math.PI / 180); context.drawImage(img, 225, 225); But here, the canvas never even shows up. I could use some help with the correct syntax. Thank you!
  13. AARRGGHHH

    Does an HTML5 Control Have Focus?

    Thank you for the reply. "return value" states: Return Value: No return value Thus, I am assuming I cannot use my code to check for focus. So, how do I check for focus? Thank you
  14. AARRGGHHH

    Does an HTML5 Control Have Focus?

    I'm having a problem determining if a given control has focus. It seems to me that: if (form.password.focus() == true) ... should tell me if the form's password control has focus. But, it's returning "false" even while I'm typing into the control. So, what is the correct way to determine whether a control has focus? Thank you!
  15. AARRGGHHH

    For Loop with Dynamically Created Variables

    dsonesuk, this worked perfectly, thank you very much for your time.
×