In this lab, lab 11, I was first introduced to J query. My assignment was to make a website, using javascript and html and css to have buttons that when you press the day button, it shows a day background and when you press the night button it shows a night background.
This is the javascript I used for the buttons:
| <body id="body"> |
| <input type="button" onclick="day();" value="Day" /> |
| <input type="button" onclick="night();" value="Night" />
|
As you can see based on the cod two buttons, clickable and when clicked equal to the value of day/night. In my code there is css as well as a link to the j query 2.1.1 that was necessary for this lab. The objective of this lab was after I saw a 10 minute video on j query, I would be able to apply what I saw in the video to make work in the class. I was able to accomplish this by following the steps in the video, applying my knowledge of css on what i thought would be a good background for day and of course downloading and a link to j query. The software I used was Dreamweaver CS6, which consisted of css, html and java script. This is relevant to web design because if I want to make a websit presentation, a good way to present an idea would be with j query, which seemed to catch my attention as well as hopefully other users.
The function used was:
| $(function() { |
| var button = $('input[type=button]'); |
| button.on('click', function() { |
| button.not(this).removeAttr('disabled'); |
| $(this).attr('disabled', ''); |
| }); |
| });
The $ stands for J query, to add on I see myself using these skills in the future as a web designer when I want to us code that isn't too complicated and something that I can use to accompany javascript an impress my client. |
No comments:
Post a Comment