I fixed the positioning of the x's and o's but I still can't figure out how to prevent the x from changing to an o. I tried to put in a statement that would check but either it doesn't work or I am not putting it in the correct place.
if (!$(this).hasClass("o")) || (!$(this).hasClass("x")) {
Thursday, April 10, 2014
Wednesday, April 9, 2014
Tic Tac Toe
Here is the newer version of my game
I would say that if I could just fix the toggle then it would be fully functional. Although, I could make it look nicer like by centering the images, making the grid bigger, etc.
I would say that if I could just fix the toggle then it would be fully functional. Although, I could make it look nicer like by centering the images, making the grid bigger, etc.
Monday, April 7, 2014
JavaScript
Questions
- What does the following expression evaluate to "var answer = (((3 * 90) === 270) || !(false && (!false)) || "bex".toUpperCase() === "BEX");"?
- Write a switch statement that uses 2 cases and a default.
- Create an object with 2 properties either using object literal notation or constructor notation.
- Access any property of the object "dog" using either bracket notation or dot notation.
- var dog = {
species: "greyhound",
weight: 60,
age: 4
}; - Make a method for an object, "rectangle", to change its height.
- var rectangle = new Object();
rectangle.height = 3;
rectangle.width = 4;
Friday, April 4, 2014
Tic Tac Toe
I got the game working for the most part but there are a couple of problems:
- When a shape is put into the grid it hugs the border when I would like it to be a bit smaller than the spot it takes up. I also had to change the circle to a square otherwise the border of the table would wrap around the circle.
- If you click on the green square when the red square is queued up it will replace the green square.
- .circle{
background-color:#00CC00;
//border-radius: 100%;
width:90px;
height:90px;
}
.square{
background-color:#FF0000;
width:90px;
height:90px; - I noticed that whichever style is first is the one that will be replaced. I think both these things have something to do with CSS specificity but I don't quite know.
Thursday, April 3, 2014
jQuery
I added some more to the To Do list, you can see it for yourself here. The only problem I currently have with it is that there is an empty bullet point.
I started on the friends list, although I did not get a lot done, but I do have all of tomorrow to work on either that or the tictactoe game.
I started on the friends list, although I did not get a lot done, but I do have all of tomorrow to work on either that or the tictactoe game.
Wednesday, April 2, 2014
jQuery
I finished up the lesson and I added the to do list to my web page. I added a bit of CSS to it to make it look better but I will have to go back to it and add more later.
http://students.gctaa.net/~snicholakos/webgraphics/todo.html
http://students.gctaa.net/~snicholakos/webgraphics/todo.html
Tuesday, April 1, 2014
JQuery
I tried out the toggleClick function but I wasn't able to get it working so I moved on to the lesson. I've finished most of the lesson and I'm hoping that by the end of it I may be able to fix my game.
This lesson mainly talked about messing with the html using JQuery
This lesson mainly talked about messing with the html using JQuery
- $(document).ready(function() {
$("#text").click(function() {
$(this).addClass("highlighted")
});
}); - For example this function adds a class to text which adds CSS to it giving it a highlighted effect(removeClass does the opposite)
- $(document).ready(function () {
$("body").append("<p>I'm a paragraph!</p>");
}); - This simply adds a paragraph to the end of the body, alternatively prepend would put it at the start
- remove gets rid of an element completely while empty gets rid of its contents
Subscribe to:
Posts (Atom)