• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Lesson 9. Using Actions and JavaScript > Adding actions to text links

Adding actions to text links

As you saw in your browser, once a More Info box is opened, there is no way to close it. You can fix this by adding mouse events to the “close this” text link already set up in the two More Info layers, ACMEInfo and FOOZInfo. If you look at the text link in the Inspector, you'll notice that it's set as a link to #—the same technique that you used earlier with images so that you could assign actions to them.

In the Layers palette, select ACMEInfo in the ID column to show the ACMEInfo layer. Make the layer visible and editable by clicking in the eye column.

Selecting the layer

Selected layer

In the document window, drag to select the “close this” text. (Be sure that you have the ACMEInfo ID selected in the Layers palette before you try to select the “close this” text in the document window. You want to highlight the text, not move the layer.)

In the Actions tab of the Rollovers & Actions palette, select the Mouse Click event, and add two actions by clicking the Create new action button () twice.

Select the first newly added None action, and choose Others > Scroll Left from the Action pop-up menu, setting Scroll Pixels to 300 and Scroll Speed to 50.

Select the second None action, and choose Multimedia > ShowHide from the Action pop-up menu.

Set Layer to be the ACMEInfo layer and Mode to Hide.

Choosing Hide from Mode pop-up menu

Hide the ACMEInfo layer by clicking in the eye column in the Layer palette.

Repeat steps 1–7 for the FOOZInfo layer.

Choose File > Save.

Click the Preview in browser button on the Document Toolbar to preview the document in the Web browser that you specified in the GoLive Preferences dialog box. You should now be able to close the stock information box.

Close your browser.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint