Category: Web Building

Scroll wheel changes selection in drop-down menus

In some of the Questionmark quizzes I’ve made there are “selection” questions, which are simply pull down menus with several possible answers to a question. I started getting emails from scroll wheel users complaining that Questionmark was changing their answers.

It turned out users would make a selection, then immediately start scrolling the wheel without deselecting the menu, so the scroll wheel would scroll within the menu. I didn’t want to disable the scroll wheel or something like that, so I looked for a way to jump the cursor out of the menu when something is selected.

Continue reading

Setting height in nested divs

Note to self: USE THE RIGHT DOCTYPE!

One of the first things we web developers usually do upon starting to using CSS is to try to recreate our old HTML multi- column layouts. which were invariably built with tables.

This turns out to be quite a challenge, particularly getting columns to be equal in height. In other words it’s difficult to get CSS-styled elements to act like a table.

I’ve found that many of the so-called 2 and 3-column CSS-only layouts get around the difficulty of making equal-height columns by using a background image in a container div that makes it appear as if the columns have backgrounds which are the same size. Clever, but it adds a little complexity and some inflexibility to the layout.

When I was first starting to convert my pages to CSS-based layouts, one of the methods I tried was to surround the columns with a container element which I hoped would transfer the height of the tallest div to the other one through the use of "height:auto" and "height:100%". It was a dismal failure, but I learned a few things in the process. Here’s what I tried:

Continue reading

PHP Alternating Color Table Rows for Drupal or Dreamweaver sites

This is based on the great tutorial by phpfreak at phpfreaks.com For a more complete explanation of this, take a look at his article.

The main variation I have made here is to adapt it for the drupal database and to separate the HTML more from the PHP to make it easier for designers to alter without needing to escape the code characters: a big source of errors for those of us who are not writing code day in and day out.

This will also work well dropped into a Dreamweaver-created php site – just change “nid” and “title” to whatever fields you want to display instead, and use the query dreamweaver generates when you define a recordset.

If you are new at this, it may go more smoothly if you first create a dynamic site in Dreamweaver, then create a dynamic table with whatever fields you want, THEN add in the additional code to generate the colors by comparing that file and this.

Continue reading

Getting cubic bezier drawing API’s to work in my projects

There are several examples of drawing methods that draw a cubic bezier line that can be changed interactively by moving two control points and two anchor points, which is exactly what I needed for a project. An example of one is HERE. This one is by Robert Penner, from his book: Robert Penner’s Programming Macromedia Flash MX”

I couldn’t figure out why I could not get these functions to work in my own pieces, even when I exactly duplicated the structure of his flash movie. They would work in his, but not in mine.

The first frame of the movie has two “include” references in it, to two actionscript files containing all the common functions for his drawing methods.


#include "drawing_api_core_extensions.as"
#include "bezier_draw_cubic.as"

Continue reading