Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. Your reference does not say it's incorrect to put lists inside a navigation region. My references, however, made it clear it was at least not incorrect. From your sources all I can see is "we don't know". I don't see any definitive prohibition for that structure. As long as we don't know, nobody can claim that something is definitively the right or wrong way to do it, and this is why beginners need not be involved in the debate.
  2. Ingolme

    HTML a rel

    The rel attribute indicates the relationship the document being linked to has with the current document. It doesn't do anything on its own but may be used by specialized browsers.
  3. But we have not even established whether or not what they've done is a flaw. We don't teach people things if we haven't established them as correct yet. From my research, I have seen nothing wrong in the way he was structuring his menu. I'm not sure where your information is coming from, but many top results in Google searches yield sites with hierarchical menus. There are many reasons why you might want a hierarchical menu, namely that many sites are hierarchically built in the first place. It's always good to organize data to make things easier to access. I have already provided you with several sources, where are yours? All I have right now supporting your position is your word alone.
  4. I'm not entirely sure what grid means, the data being two-dimensional is just speculation. I'm probably completely wrong on that. A mono-dimensional list of data looks like this: [1, 2, 3, 4] A two-dimensional list of data could look like this: [1, 2] [3, 4]
  5. This is more a question for a lawyer. Do you believe anybody is likely to sue you for the content on your website? Disclaimers are put in place when somebody is likely to file legal action against the site owner for any reason.
  6. What you've just done is create a lives method that attempts to modify addLives and subtractLives properties. I've asked you before to look up the definitions of these terms, I'll just put them right here: A property is a value that's associated to an object. It's like a variable, but attached to the object. A method is a function that's attached to an object. It's able to manipulate properties that belong to that object. A constructor is the function that creates the object (That's how it works in Javascript, in real Object-Oriented programming the definition is a bit different) Objects are created using the new keyword. If you run the constructor function without the new keyword it's not a constructor and won't give you an object. And now, I'll just solve your problem for you. This is going to cause you more harm than good, since when you encounter a situation like this in real life you won't have anybody to help you and you'll lose your job. function PlayerConst(userName, score, highScore) { this.username = userName; this.score = score; this.highScore = highScore; // Lives PROPERTY this.lives = 3; } PlayerConst.prototype.update = function(){ this.score++; if(this.score > this.highScore){ this.highScore = this.score; } } // addLife METHOD PlayerConst.prototype.addLife() { this.lives++; } // subtractLife METHOD PlayerConst.prototype.subtractLife() { this.lives--; }
  7. Whatever the correct semantic structure is, my point is that this is not something a beginner needs to be worrying about and there are no grounds to telling them that the way they're doing it is wrong.
  8. Don't precede the path with a "/" because then it will be relative to the root of the computer. Assuming the HTML file and the "examples/" directory are in the same location, this will work: <script src="examples/lib/Phaser.js" type="text/javascript"></script>
  9. I haven't yet found a practical use for the for-in loop in Javascript.
  10. The difference between width and device-width is that width refers to the width of the window and device-width refers to the width of the screen on the device. Mobile phones can be up to 1080 pixels wide, but they tell browsers that their device width is 320 or 375 pixels. The aspect ratio is the same. aspect-ratio revers to the width:height ratio of the window, while device-aspect-ratio refers to the aspect ratio of the screen. The window might not take up the full screen, sometimes there's a status bar or something at the top of the screen taking up space and making the window smaller. Colors are represented as numbers, which can be represented as a series of bits. Most software provides 8 bits per color, or 256 levels of each color, but screens can have a lot more precision than that, it just isn't always necessary. As a web developer you shouldn't have to worry about that, it's just an option in case you want to show a different color for screens that don't have enough color depth, which has not been a problem for any screen for the last 20 years. Monochrome refers to a device that only can display values of one color. It's usually represented as shades of grey, but could be shades of whichever color the screen was built in as long as it's just one color. The scanning method refers to how frames are rendered. On very primitive screens, each frame would only render every second line of pixels so they could render the images faster. It would alternate between even and odd lines on each frame. This method is called "interlacing". This is no longer necessary because cabled can transmit large amounts of data very quickly and LED monitors are much faster at refreshing than CRT monitors. I'm not entirely sure what grid is, but I think it refers to the data being two dimensional. A bitmap is a long monodimensional string of data about the values on each pixel of the screen. Media queries were designed to allow the developer to support a wide variety of devices, including very primitive ones that aren't used anymore. You won't be needing most of them.
  11. If you only had one element with a fixed position it wouldn't overlap the other fixed elements. But the best approach would be to not make a fixed header, just leave it at the top of the page. This jQuery library will make it stick to the top of the screen for you while taking care of all the little quirks that normally happen when you try to do it with just CSS: http://stickyjs.com/
  12. The first problem is that in Bootstrap, an element with class "row" must be inside an element with class "container", if not then part of the content gets cut off. On mobile devices your content is 15 pixels outside of the viewport. Another problem is that you're using position: fixed on some elements. Since you have moved it exactly 75px from the top, whenever the other fixed position element, .region-main-verytop1, is taller than 75 pixels it gets hidden behind.At most you should only have one single element with position: fixed and put all the other elements inside of that one. But a better solution would be to use Javascript to make a sticky menu so that none of them have fixed positioning and they can move flexibly to accommodate changes in size.
  13. The performance difference is negligible. The PHP executes hundreds or thousands of times faster than it takes to transfer the file's actual data, the time difference is measured in microseconds.
  14. The most immediate solution would be this: myWindow.document.write("<button onclick='window.opener.BackHere()'>Return</button>"); The BackHere() method belongs to the original window, so you need to reference the method that's on that window.
  15. I assume the drag and drop is done by event handlers attached to the elements. These event handlers were attached to the original list, but not to the new list. When you shuffle the list you need to add these event handlers to the new elements. The other solution would be to rearrange the existing elements instead of creating new ones.
  16. It's simpler than that. The chapter about objects is here: http://www.w3schools.com/js/js_objects.asp To create an object, the syntax is as you showed. var ObjectName = { aaaa: "red", bbb: "blue" }; To modify the properties of the object, just use the dot operator and then treat the properties as you would any variable; ObjectName.aaaa = "orange"; ObjectName.bbb = "green";
  17. I don't see any cells here, or any ASP code. Can you be more clear on what you're trying to do?
  18. What browser did you test it on? I don't see a reason for it to not work locally, but even then, some browser features are disabled when a page is loaded from the local filesystem. If you're serious about making websites you should install a server on your computer for testing.
  19. There's already a thread for this question. Please continue discussion here: http://w3schools.invisionzone.com/index.php?showtopic=54681
  20. That's not a constructor yet, that's a function. Do you know what a constructor is? And what a method is? You need to go back through your course material and read about constructors and methods. Here's the W3Schools page on the matter: http://www.w3schools.com/js/js_object_prototypes.asp However, I recommend you go back to learn the basics before attempting object-oriented programming. Even then, if you've never learned object-oriented programming before, Javascript is not the best language to learn it from. Javascript's version of "object-oriented" programming is very weird and does not match the actual theory of object-oriented programming.
  21. If you're taking a course then you probably should check some of your course material for the answer. If you're not taking a course then where did you find this problem? Your first answer would solve the constructor problem if the syntax was correct, but you have not created a method that returns the area. It would also be better to give a meaningful name to your object rather than "myFunct"
  22. The skills you actually need to learn are data structures and algorithms. It's not a web development thing, but programming in general. W3Schools teaches people how to make websites, if what you want to do is game development you probably should look for a game development website.
  23. What you need to do is create the element first, then add attributes. img = doc.createElement("img"); img.setAttribute("id". "2"); img.setAttribute("src", "item1.jpg"); I'm not sure if this is Java or Javascript you're talking about.
  24. Try putting the path as the src attribute of an <img> element.
  25. I don't see how it does not make semantic sense. It is a list of links. Again, how would you semantically describe a hierarchical menu? Such as - Home - Products - Product type 1 - Product type 2 - Blog - Category 1 - Category 2 - About us - Our Philosophy - Contact information
×
×
  • Create New...