Monday , 20 November 2017
Home / Tag Archives: tutorial (page 4)

Tag Archives: tutorial

Device Events – Advanced JavaScript Tutorial

Device Events

Smartphones and tablets are devices that are frequently used to browse websites. JavaScript now has a couple of events for hand held devices.  For this tutorial, you’ll need to have a mobile phone. I’ll be using the Iphone for this tutorial. Feel free to skip this tutorial if you don’t have a device handy. Orientation The orientationchange event fires when …

Read More »

Keyboard Events – Advanced JavaScript Tutorial

Keyboard Events

It’s time to take a look at keyboard events. Another popular feature of JavaScript is the capability to detect which keys were pressed and how they were pressed. Let’s first update our document to this. [crayon-5a123c2f82337184680351/] Sweet! Now, let’s clear up the script and add this bit of code. [crayon-5a123c2f82343981364120/] The first kind of event is the keydown event. This …

Read More »

Mouse Events – Advanced JavaScript Tutorial

Mouse Events

Keep track of how the mouse interacts with the web page. It is the primary device for navigation after all. Whenever mouse events occur, you’re passed in a lot of information as to where the mouse is located or what is also happening with the mouse. Let’s take a look at how this works. Coordinates We’re going to keep our …

Read More »

UI Events – Advanced JavaScript Tutorial

UI Events

UI events are events that aren’t specific to the document, but the window object. These events fire when something happens to the browser or window. Loading Events Loading events fire when the window has loaded all scripts, images, files and styles. There are also unloading events for when the user leaves the page. Update your document to this. [crayon-5a123c2f84355493323207/] Let’s …

Read More »

Event Object – Advanced JavaScript Tutorial

Event Object

The event object is passed into your function whenever an event occurs. This object contains information about the event and even allows you to change how the event phases flow. We’ll be working with our previous example. Update your script to this. [crayon-5a123c2f84c52867604463/] Our functions have been updated so that we can reference the event object. The event parameter will …

Read More »

Event Handlers – Advanced JavaScript Tutorial

Event Handlers

If you’ve seen my events tutorial in my JavaScript basics tutorial series, then you already know how to use events. There’s another way of using events with event handlers. Before we begin, let’s update the <body> tags in our document to this. [crayon-5a123c2f85626741645655/] We just have a simple button in our document with the ID btn. To add an event, …

Read More »

Data Attribute – Advanced JavaScript Tutorial

Data Attribute

HTML5 is fairly new and it’s slowly being adopted by all web browsers today. A special feature of HTML5 is the ability to define custom data attributes. A data attribute is your own attribute that can contain information about an element. Let’s update our document to this. [crayon-5a123c2f861d9445526588/] To create a data attribute, you simply create an attribute with the …

Read More »

Selectors API – Advanced JavaScript Tutorial

Selectors API

The selectors API is a simpler way to grab elements by using CSS queries. If you recall, you can change the styles of an element using CSS. Here’s an example of how you would do so. [crayon-5a123c2f86990162051843/] To grab an element in general, you just type in the tag name. To grab an element with an ID, you type a …

Read More »

Navigator Object – Advanced JavaScript Tutorial

Navigator Object

The navigator object allows you to grab information about the browser and visitor’s computer. You can grab the browser name, plugins, OS, language, etc. Properties Clear your script and add this bit of code. [crayon-5a123c2f873af157365607/] The navigator object is pretty tricky. Even though the navigator object has been around since Netscape Navigator 2, the properties and methods are supported in …

Read More »

Location Object – Advanced JavaScript Tutorial

Location Object

The location object contains information about the current URL you’re visiting. It can give you helpful information such as the port number, whether or not the site is using SSL and even allows you to redirect the user. Properties Clear your script and add this bit of code. [crayon-5a123c2f87b20236576116/] There are a couple of properties of the location object, but …

Read More »
ULTIMATE WORDPRESS DEVELOPMENT COURSE
Want to learn how to create your own custom WordPress plugins and themes? Check out my course!
Get 93% off my course. You'll also learn how to integrate WooCommerce and BuddyPress into your projects. This is a limited time offer
Yes, I would like to get 93% off your course!
No Thanks!
close-link