Links

From MegaZine3

Jump to: navigation, search
Plugin: Links
Name Links
Files
  • links.swf
Related plugins

This plugin allows to apply linking on elements. A link can be a normal link to another webpage (e.g. http://www.example.com/) or another supported protocol. A protocol is defined by the beginning of the link. The example one is defined by the http:// part. Also supported (by passing them on to a browser) protocols are:

  • https://
  • ftp://
  • file:///
  • mailto:

Advanced protocol support may be added by other plugins, which register a handler for a protocol. Examples are the anchors and JavaScript plugins, which register the protocols anchor: and javascript:, respectively. See those plugins' documentation for more information on said protocols.

Contents

[edit] Plugin interactions

The titles and overlays plugins add, when loaded, some advanced functionality to links, such as highlighting (overlay) and a tooltip with the url to which the link leads (title). This can be suppressed by assigning the respective attribute a blank value (overlay="" / title=""). If the overlays plugin is loaded, this plugin can automatically add a border overlay to linked elements. This can be suppressed by individually assigning the linked element an empty overlay attribute (overlay=""), or globally by setting the book@overlaylinks attribute to false.

[edit] Settings

linksoverlay

  • Type: Boolean
  • Default: true
  • Aliases: overlaylinks

Determines whether to automatically create overlays for linked elements or not.

[edit] Attributes

[edit] Element

url

  • Type: String

A URL to which to link. This will only be resolved if the protocol is supported, either by the links plugin itself, or another loaded plugin which registered a protocol.

[edit] Examples

<book plugins="titles,links,javascript">
    <chapter>
        <page>
            <img src="google.jpg" url="http://www.google.com/"/>
            <img top="200" src="bing.jpg" title="This links to bing." url="http://www.bing.com/"/>
            <img top="400" src="js.jpg" url="javascript:alert('Hi there!');"/>
        </page>
    </chapter>
</book>
MegaZine3 Plugin-related articles
Plugins Anchors · Background Sounds · Batchpages · Console · ElementIDs · Gallery · Google Analytics · Help · JavaScript · Keyboard Navigation · Links · NavigationBar · Options · Overlays · Password · Print · SWFAddress· Search · Sidebar · Slideshow · Titles
Plugin Articles Writing a plugin · Writing a plugin II · Plugin development
Personal tools