Creating Targets

To create targets for your anchors, you have to set the TopOffset property and/or the LeftOffset property; this will specify the position that you want the user to scroll to when the anchor is clicked. This topic, which demonstrates how to create targets in Design view and in Source view, assumes that you have attached the C1ViewScroller control to a content control and then added an anchor to the C1ViewScroller control.

In Design View

Complete the following steps:

1.   Click the smart tag () to open the C1ViewScroller Tasks menu.

2.   Click the C1ViewScroller Designer link.

The C1ViewScroller Designer Form opens.

3.   Select the anchor (C1ScrollerItem) that you wish to add the target to.

4.   In the Properties grid, complete the following:

      Set the LeftOffset property to a value, for example, "100".

      Set the TopOffset property to a value, for example, "-100".

5.   Click OK to close the C1ViewScroller Designer Form.

6.   Save the project and open it in a Studio for iPhone-compatible browser.

7.   Click the anchor and observe that it takes you to the specified offsets.

In Source View

Complete the following steps:

1.   Set the LeftOffset and TopOffset properties in XAML by adding LeftOffset="100" and TopOffset="-100" to the <C1ViewScroller:C1ScrollerItem> tag so that the markup resembles the following:

              

<C1ViewScroller:C1ScrollerItem runat="server" ScrollToId=""

   Text="C1ScrollerItem1" LeftOffset="100" TopOffset="-100" />

 

2.   Save the project and open it in a Studio for iPhone-compatible browser.

3.   Click the anchor and observe that it takes you to the specified offsets.

In Code

Complete the following steps:

1.   Add the following code to the Page_Load event:

      Visual Studio

      C#

2.   Save the project and open it in a Studio for iPhone-compatible browser to execute the program.

3.   Click the anchor and observe that it takes you to the specified offsets.


Send us comments about this topic.
Copyright © GrapeCity, inc. All rights reserved.