Jump to content


Popular Content

Showing content with the highest reputation since 08/09/2018 in all areas

  1. 1 point
    If I'm reading you correctly, (Which I hope I am) there are two ways you can do this. You can attempt that sticky navigation, with position:fixed and some position definitions Your alternative is, constrain the height of your row (I measured 380px) and use `overflow: hidden` on your cell with your row 1 column 2's in it. This will make it scroll separately, if you're putting other things on the page (Outside the cells), I recommend the fixed position solution. Scrolled Up: Scrolled Down:
  2. 1 point
    Well, it's not efficient to define a function inside another function that you're only going to use once, so if you're talking about efficiency then there's no reason to keep defining new functions every time you run that main function. Just put the code right in the one function.
  3. 1 point
    That function isn't recursive, so there's not really a reason to define a function inside another function and call it. You can just put the code inside the one function. Or, if you want to use the other function in other places, define it outside the function and just call it from inside.
  4. 1 point
    Your given code was quite hard to follow, I assume this code is supposed to count the number of property occurences of a given property for an array of objects? const countOccurences=(property, arr)=>{ let count=0 arr.map(item=>{ if(item.hasOwnProperty(property){ count++ } }) return count }
  5. 1 point
    Dsonesuk, what I understand from the discussion thus far, is that you believe that I know next to nothing about the use of margins and padding. Your criticism is well taken, since I am not completely comfortable with them. Still, I can use them quite successfully at times. It is also surely true that my webpage has been built in piecemeal fashion over a very long period of time. Had I known everything, that I know now, when I began, I surely would have built it differently. This confession, however, does not help me with my current dilemma. The DILEMMA: Although it is true that the middle section of my webpage is filled in a variety of ways, the end result is always a replacement of the current content of the #main div. Where this content comes from and in what viewport it is viewed has, unfortunately, resulted in major confusion in alignment. Now, you have been very helpful in the past, and if I have taken your goodwill for granted, I deeply apologize. Can you be clearer in your solution? Roddy
  6. 1 point
    Maybe if you actually tried to understand how padding and margin work and how they affect other elements around or within them, which is really pretty basic, it would become more obvious and therefore prevent you making the same obvious mistake in future, which will prevent having to juggle or redesign the layout as you have found. Actually I'm really annoyed by continuously going to your site and being forced to battle with annoying pop-ups everytime. YOU don't force a pop-up without user specifically choosing to see that pop-up, that's why pop-up blockers where made to prevent forced unwanted pop-ups, yours may not in your view be unwanted but give the user a choice. I can't be the only one who finds this pop-up setup annoying.
  7. 1 point
    I couldn't answer that without looking at the code which uses that array, but I imagine that the array is not constantly polled to look for new additions. In that case the array would have to be populated prior to including the other script. With modern Javascript it should be possible to use a Proxy to respond to updates on something like an array but, again, whatever the code using that array does cannot be determined without looking at the actual code. Reading through the actual code is typically the last word for these kinds of questions.
  8. 1 point
    Yeah, that's what it looks like.
  9. 1 point
    Problem Solved! All of the W3-CSS accordion examples show the < button > as the top part of the accordion and uses the w3-button class. The HTML < button > tag does not allow wrapping the display test. Period. The accordion does not have to use that HTML tag. I changed the < button > tag to a paragraph < p > tag, removed the w3-button class, kept the onclick code and other classes, and now I have a fully functional accordion where the top display text wraps appropriately, to include the text that displays below it when you click on it. All works in responsive mode as well. I did not use the bootstrap accordion as the posted advertisement above suggested! Bootstrap would NOT have worked either! It uses the < button > HTML tag as well which does not allow wrapping the upper display text. Gary (Newbie to this forum, but not to programming and web development)
  10. 1 point
    Thanks Dsonesuk, I tested my html file on your website and there was 2 errors. first one, I had the header above the body (clap clap clap) and second, my img had no alt. Those are the only errors I get. So far, the website is not hosted since I want to tests things and get better before hosting it. Planning on installing IIS on my old computer at home so I can host it myself. I checked my code again and again and I don't understand why the layout get all messed up like that. Should I make class and subclass so I could deal with the width of each block? I found it! Found a page on w3schools... Must have skipped it... My mistake : https://www.w3schools.com/css/css_website_layout.asp Thanks!
  11. 1 point
    The last rule overrides the first one. There are a set of rules by which you can always determine which CSS will be used, you can read about it here: https://www.w3schools.com/css/css_specificity.asp
  12. 1 point
    Regardless of native JS or JQuery, perhaps this would help with your understanding: <script> var globalVar = 'globalVar'; function parentFunc() { // no function parameters var parentVar = 'parentVar'; function childFunc() { // not function parameters var childVar = 'childVar'; alert('childFunc has access to:\n'+childVar+'\n'+parentVar+'\n'+globalVar); } childFunc(); alert('parentFunc has access to:\n'+parentVar+'\n'+globalVar); } alert('body has access to only:\n'+globalVar); parentFunc(); </script>
  13. 1 point
    The bizarre character has magically disappeared, but with not without a trace. For, I now see where a correction that I made in regard to the coding of the Gate Seven webpages has likely made a difference. For now, Gate Seven is working appropriately, but the Gate Seven data still appears under Gate Two. I will likely have to go into the Matomo database and remove it manually. The magical nature of what has occurred is apparently created by a Matomo time lag. What it calls today is actually yesterday. Another Matomo mystery that I will someday have to address. In any case, I am not as bad a coder as I sometimes think myself to be. Then too, it was never my goal to become one. I am becoming one by default. If Grammar Captive does not sail, then I can write code manuals and help others to overcome the frustration that Matomo has created for me. Have a great day! And, once again, thank you for your patience. Roddy