‘JavaScript’ Tagged Posts

Build Rapid Web Sites With Adobe Dreamweaver

If you have ever wanted to build your own website, you might not even know where to start. If you've done the research and you're looking for the si...

 

If you have ever wanted to build your own website, you might not even know where to start. If you’ve done the research and you’re looking for the simplest program for regular users, it’s likely that you’ve heard of Adobe Dreamweaver. This is one of the simplest web design programs to use, and the fact that it includes an HTML editor just makes it that much more useful. It doesn’t matter if you’re looking to create a website for fun or for business. There’s something for everyone in Adobe Dreamweaver, but before you get stuck into design, you need to learn how to use the program properly.

There are so many different books and tutorials out there offering Adobe Dreamweaver training, but you might not know how to choose the right one. First of all, if you want learning the program to be as simple as using it is, you’ll need to leave the books on the shelf.

Reading is great for other things, but when it comes to learning web design, having that hands-on experience can make or break your success in using the program. Just like children, who learn the alphabet much more quickly by seeing it and writing it, our brains are wired to learn things through example and by being shown. It’s human nature for us prefer “show me” rather than “tell me” when it comes to learning.

With computers, hands-on practice is essential to your understanding of everything you learn. If you can’t see the computer screen, you won’t know the difference between the pointer and the cursor, except that one is shaped like an arrow and the other is a blinking line. It’s all essentially common sense. If you use training software to learn Adobe Dreamweaver, your brain will get to observe how the program works, and duplicate it better. If you just read a book, your brain will likely get stuck between the execution and information stages and this is because it hasn’t seen the program in use before.

Adobe Dreamweaver makes website building extremely easy for just about anyone. Taking the time to invest in training software and tutorials that can show you how to succeed in web development with Dreamweaver will make learning the program just as simple as using it can be. It doesn’t matter if you’re already a web designer, or if you just want to build a basic website. You can learn Adobe Dreamweaver much more easily if you take the time to get involved in a hands-on training method.

The author is a trainer and developer with TrainingCompany.Com, an independent computer training company offering Adobe Dreamweaver Classes at their central London training centre.

Top New Features In Adobe Dreamweaver CS4

 

CSS enhancements

Spry is Dreamweaver’s Ajax solution which uses JavaScript and CSS to add sophisticated interactivity to your web pages. Dreamweaver CS4 includes some useful additions to its existing range of Spry widgets. For example, the Spry Tooltip widget allows you to create a tooltip which will appear when the mouse is placed over the specified text or object. Since the tooltip is inside a DIV element, this offers tremendous flexibility as to the appearance of the tooltip. For example, it could include an image or a Flash movie.

In Dreamweaver CS4, the Property Inspector contains buttons which allow you to switch between HTML and CSS options. When working in the CSS options, you can now target a specific CSS rule before choosing an attribute or, if necessary, create a new rule.

Additions to Dreamweaver’s Spry Widgets

Spry is Dreamweaver’s Ajax solution which uses JavaScript and CSS to add sophisticated interactivity to your web pages. Dreamweaver CS4 includes some useful additions to its existing range of Spry widgets. The Spry Validation Password widget allows you to specify the minimum and maximum number of characters, numbers, uppercase and special characters which can be included in the password entered. The Spry Validation Confirm widget checks that the entries in two fields are identical and displays a customizable error is they are not. This makes it ideal for creating “Password/Confirm Password” or “Email/Confirm Email” functionality.

Photoshop images are can be inserted using the same techniques as inserting any other image file: Insert – Image; dragging from the Files panel; dragging from the Assets panel; or using the Insert toolbar. A Photoshop-style Optimise window automatically appears and you can choose the settings appropriate for that particular image usually GIF, JPEG or PNG.

Inserting Photoshop Smart Objects

HTML is a notoriously sparse environment which relies on files created with other technologies to add functionality to web pages. Typical examples of related files are server-side includes, CSS, JavaScript and XML. Dreamweaver now includes a feature called “Related Files” which enables you to edit the content of such files, without having to open them separately, and to instantly see the effect of your changes on the main file.

Whenever you open a file which contains linked files, Dreamweaver displays each of the linked files in the Related Files Bar. To access a related file just click on its name. If you make any changes to a related file and asterisk appears next to its name in the Related Files Bar to remind you to save your changes. When you do, the impact of the changes is immediately visible in the main file.

Once the image has been imported, an icon is displayed in the upper left of the image indicating that it is a smart object. Also, in the Property Inspector, the location of the original PSD file is shown in a box marked “Original”.

The fact that the image is a smart object means that if we resize it in Dreamweaver, it will automatically be re-optimised and a new version of the image will be generated with the new dimensions. (In previous versions, resizing an image would mean that the browser was responsible for resizing leading to poor image quality.

Photoshop images are can be inserted using the same techniques as inserting any other image file: Insert – Image; dragging from the Files panel; dragging from the Assets panel; or using the Insert toolbar. A Photoshop-style Optimise window automatically appears and you can choose the settings appropriate for that particular image usually GIF, JPEG or PNG.

The Property Inspector can be used to change the attributes of any element you select on an HTML page. In previous versions of Dreamweaver, changing the attributes of highlighted text would cause the program to create CSS classes with names like “Style1″, “Style2″, etc. in the head area of the current page. This random creation of styles was often responsible for getting new web developers into bad habits.

In Dreamweaver CS4, the Property Inspector contains buttons which allow you to switch between HTML and CSS options. When working in the CSS options, you can now target a specific CSS rule before choosing an attribute or, if necessary, create a new rule.

The author is a training consultant with TrainingCompany.Com, a UK IT training company offering Adobe Dreamweaver training courses at their central London training centre.

JavaScript Without Tears Using Adobe Dreamweaver CS4

 

JavaScript is a simple, client-side scripting language which enables you to add exciting and interesting functionality to your HTML pages. It is built in to most web browsers and, although it can be deactivated, most people will have it enabled within their browser. JavaScript’s uses includes the validation of entries within an HTML form and the detection of browser versions and presence or absence of plug-ins. Dreamweaver’s implementation of JavaScript centres on the use of what it calls “behaviors”.

A behavior is simply a pre-written JavaScript function which can be triggered by a given event. To make the Behaviors window visible, choose Behaviors from the Window menu. Next select the element to which you want to attach the JavaScript. Finally, choose one of the available behaviors from the menu in Behaviors window. (The behaviors which are available will depend on the item you have highlighted.)

Whenever you attach a behavior to a web page element, Dreamweaver attempts to guess what the event which should trigger the JavaScript (mouse click, rollover, etc.). If Dreamweaver fails to assign the event that you actually want, simply choose a different event from the drop-down menu next to the event name.

Dreamweaver has a wide selection of behaviors. However, they fall into four main categories: images, windows and alerts, forms and form fields and CSS. To see how behaviors work, let us look at some examples of some behaviors in each of those categories.

Perhaps the most frequently encountered JavaScript function is one that changes the appearance of an image when the mouse passes over it. Dreamweaver creates this functionality with the “Swap Image” behavior. You can also add this behavior automatically by choosing Insert – Image Objects – Rollover Image. Dreamweaver automatically adds a second behavior/function called “Restore Image” which changes the image back to the original when the mouse leaves the image.

As far as alerts and windows behaviors is concerned, as well as the simple “Pop-up Message”, which just causes a system alert box to appear, Dreamweaver also offers the more sophisticated “Open Browser Window”. This Dreamweaver behavior allows you to create a pop-up window of any specified dimension and allows you to choose the attributes of the window: the HTML file it displays, the presence or absence of the title bar, scroll bars, etc.

The most important and useful form-handling behavior is “Validate Form”. This can be triggered either on submission of the form (“onSubmit”) or when a given text field loses focus (“onBlur”). When you assign the behavior, you choose the type of validation you wish to perform: ensuring that the field has not been left blank, contains a valid email address, contains a number or contains a number between two specific values.

An example of a behavior which manipulates CSS attributes is “Show/Hide Elements”. This enables you to control the visibility of the content inside an HTML element, such as a DIV, heading or paragraph, based on user action. So, for example, when if you have a picture of a product, you can create DIVs with information on various aspects of the product and have the appropriate DIV content become visible as the user mouses over various parts of the product image.

Each behavior that you choose will create one or more JavaScript functions within the head area of your page. Part of the process of optimising your website (both in terms of accessibility and search engine compatibility) is to transfer this code to an external JavaScript file and then link the web page to the JavaScript file. To do this, you need to be in Code view and locate the function(s) generated by the behavior(s) you have used on your page. Cut all of the code between the opening and closing SCRIPT tags and place it in a text file which needs to be saved with a .js extension. Next, enter an src attribute inside the opening SCRIPT tag, for example ‘SCRIPT src=”scripts.js”‘.

You can find out more about JavaScript training courses, visit Macresource Computer Training, a UK IT training company offering JavaScript training courses at their central London training centre.

categories: Dreamweaver,Adobe Dreamweaver CS3,JavaScript,behaviors,web development,website accessibility,computers and the internet,computer software