Dynamic Highlighting ExampleURL links can be used to navigate directly to any page of a DynaDoc document. In addition, specific text on the page can be highlighted by adding a query (?var=value) to the URL. Line 1: For example, this line will be highlighted by clicking on Line 1 next to the desired color below. Line 2: For example, this line will be highlighted by clicking on Line 2 next to the desired color below.Note that when you click on a color/line choice, the URL in the browser's address bar will include a query. By adding ?highlight1=red&highlight2=yellow you can make the lines highlight in different colors. Try it. You can use color names or RGB values, but if you use an RGB value, you must precede it by the URL encoded "#," which is "%23." For example: ?highlight1=%23FFCCFF. Try it. The highlighting relies on the get_get.js JavaScript. In order to make it possible to highlight a line, the following script must be used in place of just the page element (<p>, <div>, etc.)
<script type="text/javascript">
document.write('<tag style="background-color: ' + $_GET['name'] + '">'); </script> Replace tag with the desired page element (p, div, li, etc., but do not include < or >), and replace name with the name you plan to use for the query (highlight1 and highlight2 were used for the above lines). Using Highlights If you want to send someone a link to specific information on a page, you can include a query to highlight the information of interest. For example, if you want to highlight the LinkChecker step in the document publication process, use the following URL: To make it easier to recognize that highlighting is available on a page (and easier to cut and paste the link), a highlight icon () can be added. Using JavaScript, the highlight icon can be placed on the page and used as a link to reload the page with text highlighted. The icon would normally be placed at the beginning or end of the section to be highlighted, but can be placed anywhere on the page. Clicking on it will highlight the text associated with the referenced highlight name. To use a highlight link, include the highlight definition from above and add the following text where you want to the icon/link to appear on the page: <script type="text/javascript">highlight('highlightName','highlightColor');</script> Or, you can just include the line below in the definition script above to have the highlight appear at the beginning of the highlighted section: highlight('highlightName','highlightColor'); Replace highlightName with the name of the highlight and highlightColor with the desired color. If the color is left blank, yellow will be used. The highlight icon above is active and will highlight this entire section. Click on the highlight icon to try it. Highlighted text will only work on pages where the highlighted sections are defined in advance. |
|
|