Book Image

jQuery for Designers: Beginner's Guide

By : Natalie Maclees
Book Image

jQuery for Designers: Beginner's Guide

By: Natalie Maclees

Overview of this book

jQuery is awesome for designers ñ it builds easily on the CSS and HTML you already know and allows you to create impressive effects with just a few lines of code. However, without a background in programming, JavaScript ñ on which jQuery is built ñ can feel intimidating and impossible to grasp. This book will show you how simple it can be to learn the basics and then extend your capabilities by taking advantage of jQuery plugins.jQuery for Designers offers approachable lessons for designers with little or no background in JavaScript. The book begins by introducing the jQuery library and a small and simple introduction to JavaScript. Then you'll step through a few simple tasks to get your feet wet before diving into using plugins to quickly and simply add complex effects with just a few lines of code.You'll be surprised at how far you can get with JavaScript when you start with the power of the jQuery library and this book will show you how. We'll cover common interface widgets and effects such as tabbed interfaces, custom tooltips, and custom scrollbars. You'll learn how to create an animated navigation menu and how to add simple AJAX effects to enhance your site visitors' experience. Then we'll wrap up with interactive data grids which make sorting and searching data easy.
Table of Contents (19 chapters)
jQuery for Designers Beginner's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – styling the styleable


  1. Open up your styles.css file. We'll start off by styling the fieldsets and legends:

    fieldset  {
      background: #fff;
      border: 1px dotted #83b0ca;
      margin: 10px 20px 0 20px;
      padding:10px;
      }
    
    legend  {
      background: #bed6e3;
      border:1px solid #8fb7cf;
      color: #1C4257;
      padding: 0 5px;
      box-shadow:2px 2px 2px rgba(0,0,0,0.2);
      }

    I've selected shades of blue that match the Aristo theme that I selected. If you chose a different theme, feel free to use different colors and styles to match your chosen theme.

  2. Next, we'll style some of the container elements we're using in the form:

    fieldset p  {
      margin: 0 0 10px 0;
      }
    
    fieldset ul  {
      list-style: none;
      margin: 0;
      padding: 0;
      }
    
    label  {
      display: block;
      }
    
    ul label  {
      display: inline;
      width: auto;
      }
    
    p.buttons  {
      margin: 20px;
      }
  3. Next, we'll add some styles to that text input and textarea so they match our Aristo form elements:

    input[type="text"],
    textarea  {
      border: 1px solid ...