We launched a new IT training category! Check out the 140+ courses now.

Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Using Spry widgets

From: Dreamweaver CS5 Essential Training

Video: Using Spry widgets

As we've discussed in some of our previous movies, Spry widgets are advanced user interface controls that allow you to present your content in compelling ways. The widgets are constructed of clean HTML and styled through fully customizable CSS. The widgets available in Dreamweaver through the Insert panel are the Spry menu bar, tabbed panels, the accordion widget, collapsible panels, and the Spry Tooltip widget. The Spry Tooltip widget is one of my favorite Spry objects and it's the one we're going to use in this example.

Using Spry widgets

As we've discussed in some of our previous movies, Spry widgets are advanced user interface controls that allow you to present your content in compelling ways. The widgets are constructed of clean HTML and styled through fully customizable CSS. The widgets available in Dreamweaver through the Insert panel are the Spry menu bar, tabbed panels, the accordion widget, collapsible panels, and the Spry Tooltip widget. The Spry Tooltip widget is one of my favorite Spry objects and it's the one we're going to use in this example.

It can add a huge punch to your site and is extremely easy to work with. The Spry Tooltip works by allowing you to have a trigger object. Usually a link or an image causes a tooltip to appear somewhere else on your page. The contents, appearance, location, and behavior of the tooltip are totally customizable and can be made to integrate seamlessly into your design. In this movie, we'll use the Spry Tooltip widget to display more information about the photos in our gallery. So I have the gallery.htm file open from the 14_05 folder and I want to scroll down into my gallery, and I've got these little links that I want to act as the trigger for the tooltip, those more links.

So I'm going to go ahead and highlight the word more and it's okay also if you just click inside the word and use the Tag Selector to select the tag. That's fine, or you can highlight the word. Either way, it does not matter. I'm going to go right up to my Insert panel and I'm going to make sure I'm looking at the Spry category and I'm just going to click once on the Spry Tooltip right there. That's it. I've added a Spry Tooltip. Now I need to do that three more times. So I'm going to highlight the text, add a Spry tooltip. Again I can do that through the Properties Inspector. Even easier, something like clicking in the link, clicking the Tag Selector, clicking the tooltip. There you go.

Now we're done. Well not quite. What's happened is further down the page, we're going to see if we scroll down a little bit the Spry tooltips that just were added to the page. So when you're not in the browser and the JavaScript and CSS aren't currently interacting with each other, The Spry tooltip is basically just added below all your other content. Now that means that if somebody has JavaScript disabled in their browser, they're literally going to see the content right down here at the bottom of the page, just like that. So you may want to consider in the long run looking at how to provide alternate content for people that don't have JavaScript enabled.

Now in order to save us a little bit of time, in the interests of time, one of the things I've done is placed all of the tooltip captions down here below the tooltips themselves. So they're just sitting in paragraphs down here. Sometimes when you have multiple tooltips, the toughest part is figuring out what goes where. Notice that the first tooltip that we added to the page is at the bottom of the stacking order. So I'm going to go down and find my bottom caption which is 'This shot was sent in by Samara Iodice.' I'm just going to go ahead highlight all that text and I'm just going to cut it.

So that would be Ctrl+X or Command+X. Then I'm going to go to the sprytooltip1. Again that's the bottom one. I'm going to highlight the default text and I'm going to paste just to place that into my tooltip. I need to do that for each of these guys. So I'm going to a highlight the text for the next one, cut it, move up to my tooltip, and I'm just going to up in order and paste it to replace that default text. Same thing for my next one, and then finally I'm going to grab 'Max Smith sends in a picture from Orange Grove,' cut that one, and paste that one in the tooltip as well.

The result of that is going to be a couple of empty paragraphs down at the bottom of the page. So I'm going to scroll down, click in that bottom paragraph, and I'm just going to keep hitting Delete until I get back to my tooltips. I don't want to delete any of the tooltips so be careful about that, but I don't want a bunch of empty paragraphs down at the bottom of my page either. I'm going to go ahead and save this file and as soon as I do that, notice that Dreamweaver says, "hey wait a second. "You've use a Spry Tooltip widget. I need the external CSS and external "JavaScript in order to make that widget work. "So I'm going to copy that your site." I'm going to go ahead and click OK and I notice that now we have a brand-new folder and I may have to refresh my site to get that, but I have a brand new folder called SpryAssets and those guys are located right there.

Now occasionally, you may not want them to go in the SpryAssets folder. You may already have a Scripts folder that you want them to move inside of, or you may have another destination within your site that you want those to go. Well if you go your Site Setup dialog box and remember you can get there by simply clicking the name of the site itself right over here in the Files panel. You can go down your Advanced settings, and one of those settings is Spry, You can tell exactly which directory to use when placing SpryAssets on the page. Currently, we have it set to the default, but you can set that anywhere that you'd like.

Okay, so after I've saved that, I'm going to go ahead and preview that in my browser and now if I hover over one of those links now I see my tooltip. Well, okay it doesn't look great but at least it's functional. So the next thing I want to do is figure out how I can control where this tooltip appears. You can see it's occurring just sort of to the right of the link itself and I need a little bit more control over that. So I'm going to close my browser, go back in the Dreamweaver, and I'm going to stay at the bottom of the page.

I'm going to mouse over each of the Spry tooltips in turn and then click on this blue tab. That will select the Spry tooltip but more importantly, notice that the Properties Inspector is now giving me a lot of options in regards to my Spry tooltip. Now one of the first things I'm going to do is set a horizontal and vertical offset. Whenever somebody hovers over your trigger link, Dreamweaver is going to take a look at the offset values for horizontal and vertical and it's going to move up and away from the current position of the mouse. So I'm going to do a horizontal offset for my first one of -200 pixels.

That's going to move the tooltip 200 pixels to the left. I'm then going to do a vertical offset of -290 pixels. That's going to move my tooltip up. So my tooltip is going to be moved up and to the left. I can also choose an effect for the tooltip and I really like the Fade effect. That's going to fade it in a little bit and again it's going to fade it out. We can also put a Show or Hide delay in and I'm going to put a High delay of 500. That value is in milliseconds. So that means that after I mouse off of the link for the tooltip, the tooltip will stay up there for about a half- a-second and then sort of disappear.

It's also going to fade. We also have the option of having the tooltip follow the mouse. So if you were to move your mouse around within a link, the tooltip would follow it. We also have the ability to hide it if you mouse outside of the tooltip, but we're going to allow the link itself to control that functionality. So I'm going to leave both of those unchecked. I need to do that for each of these but I have a slight change for the second one. I'm going to go up to my second one and again I'm going to click that blue tab right there, it brings it up in the Properties Inspector, and this time my horizontal offset is going to be the same, -200 pixels, but the vertical offset is going to be -270 pixels. Why is that? Honestly I don't know.

As I was experimenting with those values, I noticed that the first one needed a slightly larger vertical offset then the others. It just happens that way sometimes. It might have something to do with the order that are found within the code. Who knows? But the key is that you can come back in here and experiment with this as much as you want to ensure that you're getting the desired effect. I'm once again going to give it a Hide delay of 500 and then an effect of Fade. Now I'm just going to be repeating that twice more. tooltip3, it's going to get -200 pixels horizontal offset. It's going to get -270 pixels of vertical offset.

Hide delay is going to be 500. I'm going to fade that in and out. And then finally my last tooltip, -200 pixels for the horizontal offset, -270 pixels for the vertical offset, and then a Hide delay of 500 and we're going to fade it out. I'm going to save that. Preview that in my browser. Now when I hover over them, the tooltip is not showing up right on top of my link and it's sort of over to the left little bit.

So that looks a lot better. It doesn't integrate with my design at all. There's no fixed width on these things. They're stretching out. They're hovering over everything. The typography and the color doesn't look right. So the last thing we need to do is go modify the CSS for these tooltips so that they look a little bit more integrated within our site. So I'm back in Dreamweaver now and I want to go ahead and modify the CSS for this. Now if I go over to my CSS Styles panel and I think I'm going to collapse the Files panel, just give myself a little bit more room. I can collapse the main.css, close that down, and I see that there is my external SpryTooltip.css.

You know there's really not a lot of driving this. If you click on the .tooltipContent class, that is being applied to each of the div tags that contains the tooltip. The only property on that is a background color that's sort of a cream color. So what I'm going to do is go up to my tooltipContent rule and double-click that to open up the CSS Rule Definition dialog box. I want to make a couple of really basic changes here. My font-size is going to change to 0.7em. My line-height is going to be 1.6 and I'm going to do a multiple there. I'm going to go to the Block category and do a text-align of left so that so that my text won't be centered.

Then I'm going to go to over my Box properties. In my Box properties, I'm going to deselect the Same for all. I'm going to do 10 pixels worth of top padding, 10 pixels worth of right padding, 10 pixels worth of left padding, but I'm going to do 30 pixels worth of bottom padding. I'm also going to give it an assigned width of 320 pixels. Now why in the world that I change it and give it 30 pixels worth of bottom padding? I did that because we're also going to apply a background image to our div tags. I'm going to go to my Background category and I'm just going to remove the background color itself. I don't want anything there.

And for background-image, I'm going to Browse. Again I'm going to switch to details so I can see a little bit better and what I'm looking for is right down here quote_box.png. This is a transparent PNG file and it's kind of a blue sort of Word bubble look to it, then it kind of fades out at it gets taller, but you'll notice there is some space down here at the bottom. I don't want the text to come into this transparent area. So that's why we have all that bottom padding. I'm going to go ahead and click OK. For background-repeat, I'm going to choose no-repeat and then I want to attach this to the right bottom of the parent element.

That way the bottom of the tooltip will always have that sort of word balloon down at the bottom of it. So I'm going to go ahead and click OK and we can see it right off the bat that our tooltips have changed. All right let's do a Save All, preview that in our browser, and test out your tooltips. Cool, working exactly the way that we wanted them to. Well as you can see, Spry content is incredibly easy to add to your page and its nice to know that Dreamweaver takes care of adding the JavaScript and CSS files to our site necessary for the spry content's functionality.

The tooltip widget is only one of the many cool Spry widgets available in Dreamweaver. I want to encourage you to take some time to experiment with different widgets and play around with their settings and the CSS that controls them. You'll find that in no time you're going to be comfortable in creating and deploying customized Spry widgets that integrate seamlessly into your site.

Show transcript

This video is part of

Image for Dreamweaver CS5 Essential Training
Dreamweaver CS5 Essential Training

135 video lessons · 89275 viewers

James Williamson
Author

 
Expand all | Collapse all
  1. 2m 57s
    1. Welcome
      1m 8s
    2. Using the exercise files
      1m 49s
  2. 7m 50s
    1. What is Dreamweaver?
      3m 16s
    2. Learning web design
      2m 22s
    3. Current web standards
      2m 12s
  3. 43m 9s
    1. The Welcome screen
      4m 5s
    2. Windows and Mac interface differences
      2m 23s
    3. The Application toolbar
      4m 7s
    4. The Document toolbar
      4m 40s
    5. Arranging panels
      8m 19s
    6. Managing workspaces
      7m 32s
    7. The Properties Inspector
      5m 54s
    8. The Insert panel
      6m 9s
  4. 25m 45s
    1. Basic site structure
      3m 11s
    2. File naming conventions
      1m 49s
    3. Defining a new site
      4m 35s
    4. Managing sites
      4m 51s
    5. Managing files and folders
      6m 36s
    6. Working with browsers
      4m 43s
  5. 27m 21s
    1. Creating new documents
      5m 16s
    2. New document preferences
      3m 6s
    3. Setting accessibility preferences
      4m 56s
    4. Working with starter pages
      3m 46s
    5. Managing starter pages
      10m 17s
  6. 30m 2s
    1. Basic tag structure
      2m 15s
    2. Adding structure to text
      8m 20s
    3. Creating lists
      9m 59s
    4. Getting text into Dreamweaver
      5m 59s
    5. Importing Word documents
      3m 29s
  7. 1h 17m
    1. Understanding style sheets
      2m 16s
    2. The anatomy of a CSS rule
      1m 48s
    3. Setting CSS preferences
      6m 36s
    4. The CSS Styles panel
      10m 2s
    5. Controlling CSS through the Properties Inspector
      5m 14s
    6. Using the Code Navigator
      7m 21s
    7. Using CSS Enable
      6m 45s
    8. Understanding element selectors
      8m 11s
    9. Understanding class selectors
      8m 49s
    10. Understanding ID selectors
      5m 59s
    11. Understanding descendant selectors
      6m 51s
    12. Attaching external style sheets
      7m 44s
  8. 1h 47m
    1. Working with units of measurement
      7m 11s
    2. Declaring font families
      9m 39s
    3. Controlling font sizing
      9m 9s
    4. Controlling weight and style
      8m 0s
    5. Controlling line height
      8m 29s
    6. Controlling vertical spacing with margins
      12m 3s
    7. Controlling spacing with padding
      5m 39s
    8. Aligning text
      8m 26s
    9. Transforming text
      5m 36s
    10. Writing global styles
      15m 42s
    11. Writing targeted styles
      17m 37s
  9. 1h 32m
    1. Understanding image types
      5m 3s
    2. Managing assets in Dreamweaver
      12m 51s
    3. Setting image accessibility preferences
      4m 20s
    4. Setting external image editing preferences
      3m 52s
    5. Placing images on the page
      7m 37s
    6. Photoshop integration
      5m 54s
    7. Modifying Smart Objects
      5m 51s
    8. Alternate Photoshop workflows
      8m 8s
    9. Modifying image properties
      11m 14s
    10. Styling images with CSS
      7m 11s
    11. Using background graphics
      9m 3s
    12. Positioning background graphics
      11m 6s
  10. 55m 16s
    1. Link basics
      3m 37s
    2. Setting site linking preferences
      2m 14s
    3. Creating links in Dreamweaver
      11m 1s
    4. Absolute links
      5m 8s
    5. Using named anchors
      11m 19s
    6. Linking to named anchors in external files
      2m 44s
    7. Creating an email link
      5m 24s
    8. Creating CSS-based rollovers
      13m 49s
  11. 1h 34m
    1. CSS structuring basics
      2m 56s
    2. The Box Model
      13m 21s
    3. Understanding floats
      6m 53s
    4. Clearing and containing floats
      8m 56s
    5. Using relative positioning
      4m 8s
    6. Using absolute positioning
      7m 18s
    7. Creating structure with div tags
      12m 7s
    8. Styling basic structure
      10m 34s
    9. Creating a two-column layout
      10m 37s
    10. Using Live View and CSS Inspect
      7m 51s
    11. Using Browser Lab
      9m 39s
  12. 56m 22s
    1. Reviewing table structure
      7m 41s
    2. Importing tabular data
      5m 13s
    3. Creating accessible tables
      9m 56s
    4. Using thead and tbody tags
      4m 0s
    5. Basic table styling
      8m 45s
    6. Styling table headers
      7m 52s
    7. Styling column groups
      4m 22s
    8. Creating custom table borders
      5m 1s
    9. Styling table captions
      3m 32s
  13. 1h 43m
    1. How forms work
      3m 0s
    2. Reviewing form design
      3m 2s
    3. Creating accessible forms
      7m 33s
    4. Setting form properties
      4m 6s
    5. The fieldset and legend tags
      4m 32s
    6. Inserting text fields
      5m 58s
    7. Inserting list menu items
      5m 26s
    8. Inserting checkboxes
      7m 50s
    9. Inserting radio button groups
      6m 22s
    10. Inserting text areas
      4m 12s
    11. Inserting submit buttons
      3m 37s
    12. Basic form styling
      12m 0s
    13. Form element styling
      8m 52s
    14. Styling form layout
      11m 49s
    15. Adding form interactivity
      2m 47s
    16. Using Spry validation widgets
      12m 49s
  14. 1h 23m
    1. Planning for templates
      10m 51s
    2. Creating a new template
      10m 37s
    3. Using editable attributes
      13m 43s
    4. Creating optional regions
      6m 23s
    5. Creating new pages from a template
      9m 17s
    6. Applying templates to existing pages
      6m 9s
    7. Working with nested templates
      7m 56s
    8. Working with repeating regions
      12m 58s
    9. Modifying templates
      5m 41s
  15. 40m 14s
    1. Behaviors overview
      3m 47s
    2. Hiding and showing elements
      9m 18s
    3. Spry overview
      4m 4s
    4. Using Spry widgets
      11m 36s
    5. Adding Spry effects
      3m 6s
    6. Using the Widget Browser
      8m 23s
  16. 28m 18s
    1. Inserting Flash files
      5m 4s
    2. Setting properties for Flash
      6m 27s
    3. Dreamweaver and Flash integration
      6m 6s
    4. Encoding Flash video
      6m 10s
    5. Adding Flash video
      4m 31s
  17. 45m 28s
    1. Running site-wide reports
      6m 33s
    2. Checking for broken links
      5m 41s
    3. Checking for browser compatibility
      8m 3s
    4. Adding remote servers
      8m 0s
    5. Uploading files
      7m 20s
    6. Managing remote sites
      9m 51s
  18. 34s
    1. Goodbye
      34s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ .

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now Already a member? Log in

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Dreamweaver CS5 Essential Training.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member ?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferences from the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.