Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. Don't do this. Don't style each individual button and don't use position absolute. Absolute position is OK if they're inside a container with a relative position and everything has a specific pixel size.
  2. selectRound() doesn't return anything, it replaces the images on its own. You can't assign it to a variable nor concatenate it with a string. Here's how it should be used: function reposition() { selectRound(round2); // changes the images of the puzzle pieces automatically // I'm not sure what these loops are meant to do for (var y=0; y<2; y++) { for (var x=0; x<2; x++) {
  3. PHP has a few iterating functions. Such as each(), current(), and next(). Here's an example while($item = each($arr)) { echo $item . '<br>';} But you can print elements in an array without them, the more common way: foreach($arr as $item) { echo $item . '<br>';}
  4. Up to now I have found only two legitimate uses for a <br> element: Line breaks in a mailing address. Line breaks in poetry. If you use <br> to create vertical space you'll find yourself with a lot of work to do when you decide to change how large you want to space to be on 20 different pages on your site.
  5. Make an array for each round. var round1 = [ "p1.png", "p2.png", "p3.png", "p4.png" ];var round2 = [ "p5.png", "p6.png", "p7.png", "p8.png" ]; Make a function that selects a round function selectRound(round) { for(var i = 0; i < tiles.length; i++) { tiles[i].src = round[i]; }} Call that function when you want to change the tile images: selectRound(round2);
  6. This is the concept being referred to: http://en.wikipedia.org/wiki/Escape_character You want to put a double-quote inside a string delimited by double-quotes. The solution is to use what's called an "escape sequence" or "escape character". Different programming languages have different ways to do it.
  7. Set the line-height to the same value as the height.
  8. Before you go any further, make sure you have completely addressed all the SQL injection problems in your code. After that, show the query you're using to add the values and explain what happens when you try it.
  9. I see what's wrong with your code. You're using a <div> and the <div> element does not have a value attribute. That's why it stopped working. Make sure your code is valid. If it isn't then Javascript and CSS will behave unexpectedly. Check your code for validity here: http://validator.w3.org/ The first thing you have to do to make it valid is give the HTML 5 doctype to your document. You should have a class name in common between all the buttons to give them styles they all have alike and use their IDs to give them styles they have unique to them Your markup should be something like this: <div><input class="button" id="button_1" type="button" name="no" value="1" onClick="NUMBERS(this.value)"><input class="button" id="button_2" type="button" name="no" value="2" onClick="NUMBERS(this.value)"><input class="button" id="button_3" type="button" name="no" value="3" onClick="NUMBERS(this.value)"><input class="button" id="button_4" type="button" name="no" value="4" onClick="NUMBERS(this.value)"><input class="button" id="button_5" type="button" name="no" value="5" onClick="NUMBERS(this.value)"><input class="button" id="button_6" type="button" name="no" value="6" onClick="NUMBERS(this.value)"><input class="button" id="button_7" type="button" name="no" value="7" onClick="NUMBERS(this.value)"><input class="button" id="button_8" type="button" name="no" value="8" onClick="NUMBERS(this.value)"><input class="button" id="button_9" type="button" name="no" value="9" onClick="NUMBERS(this.value)"><input class="button" id="button_0" type="button" name="no" value="0" onClick="NUMBERS(this.value)"></div> The stylesheet would be like this: .button { display: block; margin: 0; padding: 0; width: 80px; height: 80px; position: absolute; color: #00F349; text-align: center; border: thin solid #00F349; background-color: #000000; font-size: 50px; vertical-align: middle;}.button:active { background-color: #00F349; color: #000;}#button_1 { top: 50px; left: 0;}#button_2 { top: 50px; left: 80px;}#button_3 { top: 50px; left: 160px;}/* . . . */
  10. In your code you seem to have cut off the last value by putting the semi-colon after the third one.
  11. It will work if your script was working before. CSS and Javascript don't interfere with each other.
  12. XAMPP and the database can handle anything you give them. If it's not working there's something wrong in your code. What table structure are you using?
  13. I can't tell at a glance why that would interfere, but you could use the CSS :active selector instead of using mousedown and mouseup events: button_1:active { background-color: #00F349; color: #000;} You probably should give all your buttons the same class name and just use the ID for the unique selector. Having class="button_1" id="button_1" is redundant. You could change the class to just "button"
  14. Check the values of txt and of num to see which of the two is causing the operation to result in NaN.
  15. I don't think I've seen all your code. Does the error message specifically say "functionName()" or does it say "getImage()"?
  16. It sounds like PHP isn't being executed. At least two conditions need to be met for PHP to work: It's running on a server that can execute PHP The file has a .php extension, not .html.
  17. That sounds like a message in the console. I was asking about the HTML. If you right click and select "View source" what does the <img> tag look like?
  18. Have you checked the source code of the page to see what is actually in the src attribute? I assume either an error message, an empty string or multiple filenames.
  19. The problem is that you've written NUMBERS(this,value) instead of NUMBERS(this.value)
  20. That solution has A B and C on the same row. C should be below A and B. col-xs-12 is redundant, since that's the default unless specified otherwise.
  21. While the solution works (I was thinking of it earlier) duplicate content is bad for search engine optimization and especially confusing for people browsing with a screen reader.
  22. Like it was mentioned, your stylesheet should go after bootstrap's stylesheet. After that, check the DOM tab in the developer tools of you browser to see which selectors are being used to style an element. To override an existing selector your selector needs to be more specific. How do you make a selector more specific? Here are a few ways: Add an ID to the selector. IDs have the highest precedence. Have more components than the selector you're trying to override. For example: span.class is more specific than .class and ul.menu li a is more specific than .menu a
  23. That's still not going to work. Read my more recent reply.
  24. " causes the HTML to not work. In some languages escaping quotes is done with a backslash ("). This looks similar to ASP, I think in ASP you escape a quote by writing it twice: ""
  25. It's not the lack of code block that caused this, this is his own code. Since &quote; is not actually a real HTML entity it's clear he typed that himself.
×
×
  • Create New...