Attributes
Introduction
Most aspects of the appearance and behaviour of elements on a webpage are controlled by the attributes of those elements. Everything from simple background fills to complex AJAX functionality all involve changing attributes of elements.
In Flux, attributes are changed using the Inspector and you can change most attributes with standard Mac controls, and no HTML coding at all.
Create a Div to be changed
To get started, first create a Div on the page, you can do this using the
Quick Div function. This will put a simple Div onto your page, ready to be changed.
Setting simple attributes
Now select the Div, and open the
Inspector from the toolbar.
You can now start to change basic attributes of the selected div, we will start by changed the background colour. You will see in Flux that categories of attributes are listed in the left column of the Inspector, this is because there are so many HTML attributes that we need to sort them into a manageable list. You will see that there is a category called
"Fill". If you click this category, you will see all the different types of fill available. By clicking any of the fill attributes, you get the opportunity to edit them. Now click
background-color and now you can choose a new colour for the div.
Setting more advanced attributes
Now select
Attributes & Actions and select to add a new action. For this action, we will choose the
onClick action, so that when a user clicks on the div, we know about it can can run some JavaScript.
We can now enter some simple JavaScript, in this case we will choose to show a simple
alert window to say the word "Hello!".
Now when we show the page in
Preview, and click on the Div, it will show a Javascript alert window.