Archive for January, 2009

Refining CSS Rollover Images Even Further

Sometimes you think your making things as simple as you can and yet your not. This method only uses CSS so no need to worry about JavaScript. However it requires a class for each size of button. But for most designs the size will be the same so this is not a problem.

Example

Refining CSS Rollover Images

I’ve just been trying to refine CSS rollovers using some JavaScript. The JavaScript gets the height of the block element and positions the background image relatively. The system reverts to text links should CSS or JavaScript fails.

Example

Modal Window with "autoOpen" set to false

Setting autoOpen to false and triggering it to open through separate calls is a better way to use modal windows.

<script>
$(document).ready(function(){
//Modal dialog
$("#register_form").dialog({
modal: true,
resizable: false,
autoOpen: false,
overlay: {
opacity: 0.5,
background: "black"
}
});
$("#register").click(function (e) {
e.preventDefault();
$("#feedback_content").dialog("open");
});

$("#register").click(function (e) {
e.preventDefault();
$("#feedback_content").dialog('close');
});
});
</script>

Modal Window – JQuery

A quick JQuery test which creates a modal window with rounded corners.

example

The modal window is a standard JQuery dialog box with the visibility changed to accommodate curvy corners.