Thursday, November 17, 2016

Rollover Lab 6

In this lab we made a rollover using different programs and softwares. The html rollover works when the mouse hovers over it. The photoshop rollover swaps through images at  regular pace disregarding the user. The javascript rollover is the most interactive because the big images changes to the small image that the mouse hovered over last. The hardest part of this lab was the upload because the server crashed. I had to upload my lab off Niocities.org. This was a problem because the smaller images from the javascript rollover were broken. This would not have happened in Dreamweaver's servers. 

Thursday, November 10, 2016

Switch and loops

Today I read about switches and loops. The format for the switch is switch(expression) {case n:  code block break;case n: code block break;default:default code block}. It seemed easy on the test run and on the definitions, however it was not. I tried to use the switch in my game of choice and it did not work. I could not figure out what was wrong with my code. I even had it in the right format! This was by far the most difficult code that I have come across by far. The for loop was easy to understand as well but had a more complex format. There were too many formats to copy here solely because there were many variants of the loop. I have used it in the exercises and in code academy and it was fairly easy to use. Some problems that I came across were the infinite looping caused by syntax errors. This code is something that I can see myself using but would have to check the format every time I used it. I personally dislike the switch because of my past experience, but I look forward to using the loop more.

Tuesday, November 1, 2016

JavaScript Conditionals

              Today I learned about JavaScript conditionals. They are used to execute codes that are dependent on a condition. This condition may or may not be satisfied in order to get something done. If/else statements are the perfect example of this. Tf the condition is true then a code will be executed. If the condition is false, another code will be executed. These may have more than one result through the else if option of adding another condition. Switches are basically the same thing with a different format and an unlimited number of conditions. This will be useful in the future for when we put it to work.