新书推介:《语义网技术体系》
作者:瞿裕忠,胡伟,程龚
   XML论坛     W3CHINA.ORG讨论区     计算机科学论坛     SOAChina论坛     Blog     开放翻译计划     新浪微博  
 
  • 首页
  • 登录
  • 注册
  • 软件下载
  • 资料下载
  • 核心成员
  • 帮助
  •   Add to Google

    >> 本版讨论SVG, GML, X3D, VRML, VML, XAML, AVALON, Batik等基于XML的图形技术,以及有关GIS的应用。
    [返回] 中文XML论坛 - 专业的XML技术讨论区XML.ORG.CN讨论区 - 高级XML应用『 SVG/GML/VRML/X3D/XAML 』 → svg响应事件列表 查看新帖用户列表

      发表一个新主题  发表一个新投票  回复主题  (订阅本版) 您是本帖的第 8055 个阅读者浏览上一篇主题  刷新本主题   树形显示贴子 浏览下一篇主题
     * 贴子主题: svg响应事件列表 举报  打印  推荐  IE收藏夹 
       本主题类别:     
     卷积内核 帅哥哟,离线,有人找我吗?
      
      
      威望:8
      头衔:总统
      等级:博士二年级(版主)
      文章:3942
      积分:27590
      门派:XML.ORG.CN
      注册:2004/7/21

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给卷积内核发送一个短消息 把卷积内核加入好友 查看卷积内核的个人资料 搜索卷积内核在『 SVG/GML/VRML/X3D/XAML 』的所有贴子 访问卷积内核的主页 引用回复这个贴子 回复这个贴子 查看卷积内核的博客楼主
    发贴心情 svg响应事件列表

    svg中响应的事件列表

       收藏   分享  
    顶(0)
      




    ----------------------------------------------
    事业是国家的,荣誉是单位的,成绩是领导的,工资是老婆的,财产是孩子的,错误是自己的。

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2004/8/2 10:34:00
     
     admin 帅哥哟,离线,有人找我吗?
      
      
      
      威望:9
      头衔:W3China站长
      等级:计算机硕士学位(管理员)
      文章:5255
      积分:18406
      门派:W3CHINA.ORG
      注册:2003/10/5

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给admin发送一个短消息 把admin加入好友 查看admin的个人资料 搜索admin在『 SVG/GML/VRML/X3D/XAML 』的所有贴子 点击这里发送电邮给admin  访问admin的主页 引用回复这个贴子 回复这个贴子 查看admin的博客2
    发贴心情 
    为方便大家阅读,先将内容贴出来

    [URL=http://www.w3.org/TR/SVG/filters.html]previous[/URL]   [URL=http://www.w3.org/TR/SVG/linking.html]next[/URL]   [URL=http://www.w3.org/TR/SVG/index.html#minitoc]contents[/URL]   [URL=http://www.w3.org/TR/SVG/eltindex.html]elements[/URL]   [URL=http://www.w3.org/TR/SVG/attindex.html]attributes[/URL]   [URL=http://www.w3.org/TR/SVG/propidx.html]properties[/URL]   [URL=http://www.w3.org/TR/SVG/indexlist.html]index[/URL]  


    --------------------------------------------------------------------------------

    14 January 2003

    16 Interactivity


    Contents
    [URL=http://www.w3.org/TR/SVG/interact.html#Introduction]16.1 Introduction[/URL]
    [URL=http://www.w3.org/TR/SVG/interact.html#SVGEvents]16.2 Complete list of supported events[/URL]
    [URL=http://www.w3.org/TR/SVG/interact.html#UIEvents]16.3 User interface events[/URL]
    [URL=http://www.w3.org/TR/SVG/interact.html#PointerEvents]16.4 Pointer events[/URL]
    [URL=http://www.w3.org/TR/SVG/interact.html#UIEventProcessing]16.5 Processing order for user interface events[/URL]
    [URL=http://www.w3.org/TR/SVG/interact.html#PointerEventsProperty]16.6 The 'pointer-events' property[/URL]
    [URL=http://www.w3.org/TR/SVG/interact.html#EnableZoomAndPanControls]16.7 Magnification and panning[/URL]
    [URL=http://www.w3.org/TR/SVG/interact.html#Cursors]16.8 Cursors[/URL]
    [URL=http://www.w3.org/TR/SVG/interact.html#CursorIntro]16.8.1 Introduction to cursors[/URL]
    [URL=http://www.w3.org/TR/SVG/interact.html#CursorProperty]16.8.2 The 'cursor' property[/URL]
    [URL=http://www.w3.org/TR/SVG/interact.html#CursorElement]16.8.3 The 'cursor' element[/URL]
    [URL=http://www.w3.org/TR/SVG/interact.html#document-events-att-mod]16.9 Document Events Attribute Module[/URL]
    [URL=http://www.w3.org/TR/SVG/interact.html#graphical-events-att-mod]16.10 Graphical Events Attribute Module[/URL]
    [URL=http://www.w3.org/TR/SVG/interact.html#animation-events-att-mod]16.11 Animation Events Attribute Module[/URL]
    [URL=http://www.w3.org/TR/SVG/interact.html#cursor-mod]16.12 Cursor Module[/URL]
    [URL=http://www.w3.org/TR/SVG/interact.html#DOMInterfaces]16.13 DOM interfaces[/URL]

      
    16.1 Introduction
    SVG content can be interactive (i.e., responsive to user-initiated events) by utilizing the following features in the SVG language:

    User-initiated actions such as button presses on the pointing device (e.g., a mouse) can cause [URL=http://www.w3.org/TR/SVG/animate.html]animations[/URL] or [URL=http://www.w3.org/TR/SVG/script.html]scripts[/URL] to execute.
    The user can initiate hyperlinks to new Web pages (see [URL=http://www.w3.org/TR/SVG/linking.html#Links]Links out of SVG content: the 'a' element[/URL]) by actions such as mouse clicks when the pointing device is positioned over particular graphics elements.
    In many cases, depending on the value of the [URL=http://www.w3.org/TR/SVG/interact.html#EnableZoomAndPanControls]zoomAndPan[/URL] attribute on the [URL=http://www.w3.org/TR/SVG/struct.html#SVGElement]'svg'[/URL] element and on the characteristics of the user agent, users are able to zoom into and pan around SVG content.
    User movements of the pointing device can cause changes to the [URL=http://www.w3.org/TR/SVG/interact.html#Cursors]cursor[/URL] that shows the current position of the pointing device.
    This chapter describes:

    information about [URL=http://www.w3.org/TR/SVG/interact.html#SVGEvents]events[/URL], including under which circumstances events are triggered
    how to indicate whether a given document can be [URL=http://www.w3.org/TR/SVG/interact.html#EnableZoomAndPanControls]zoomed and panned[/URL]
    how to specify which [URL=http://www.w3.org/TR/SVG/interact.html#Cursors]cursors[/URL] to use
    Related information can be found in other chapters:

    hyperlinks are discussed in [URL=http://www.w3.org/TR/SVG/linking.html]Links[/URL]
    scripting and event attributes are discussed in [URL=http://www.w3.org/TR/SVG/script.html]Scripting[/URL]
    SVG's relationship to DOM2 events is discussed in [URL=http://www.w3.org/TR/SVG/svgdom.html#RelationShipWithDOM2Events]Relationship with DOM2 event model[/URL]
    animation is discussed in [URL=http://www.w3.org/TR/SVG/animate.html]Animation[/URL]
    16.2 Complete list of supported events
    The following aspects of SVG are affected by events:

    Using [URL=http://www.w3.org/TR/SVG/svgdom.html]SVG Document Object Model (DOM)[/URL], a script can register [URL=http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-Registration-interfaces]DOM2 event listeners[/URL] so that script can be invoked when a given event occurs.
    SVG includes [URL=http://www.w3.org/TR/SVG/script.html#EventAttributes]event attributes[/URL] on selected elements which define script that can be executed when a given event occurs in association with the given element.
    SVG's [URL=http://www.w3.org/TR/SVG/animate.html#Animation.class]animation elements[/URL] can be defined to begin or end based on events.
    The following table lists all of the events which are recognized and supported in SVG. The Event name in the first column is the name to use within SVG's [URL=http://www.w3.org/TR/SVG/animate.html#Animation.class]animation elements[/URL] to define the events which can start or end animations. The DOM2 name in the third column is the name to use when defining [URL=http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-Registration-interfaces]DOM2 event listeners[/URL]. The Event attribute name in the fifth column contains the corresponding name of the [URL=http://www.w3.org/TR/SVG/script.html#EventAttributes]event attributes[/URL] that can be attached to elements in the SVG language.

    Event name Description DOM2 name DOM2 category Event attribute name
    focusin Occurs when an element receives focus, such as when a [URL=http://www.w3.org/TR/SVG/text.html#TextElement]'text'[/URL] becomes selected. DOMFocusIn [URL=http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-UIEvent]UIEvent[/URL] [URL=http://www.w3.org/TR/SVG/script.html#OnFocusInEventAttribute]onfocusin[/URL]
    focusout Occurs when an element loses focus, such as when a [URL=http://www.w3.org/TR/SVG/text.html#TextElement]'text'[/URL] becomes unselected. DOMFocusOut [URL=http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-UIEvent]UIEvent[/URL] [URL=http://www.w3.org/TR/SVG/script.html#OnFocusOutEventAttribute]onfocusout[/URL]
    activate Occurs when an element is activated, for instance, thru a mouse click or a keypress. A numerical argument is provided to give an indication of the type of activation that occurs: 1 for a simple activation (e.g. a simple click or Enter), 2 for hyperactivation (for instance a double click or Shift Enter). DOMActivate [URL=http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-UIEvent]UIEvent[/URL] [URL=http://www.w3.org/TR/SVG/script.html#OnActivateEventAttribute]onactivate[/URL]
    click Occurs when the pointing device button is clicked over an element. A click is defined as a mousedown and mouseup over the same screen location. The sequence of these events is: mousedown, mouseup, click. If multiple clicks occur at the same screen location, the sequence repeats with the detail attribute incrementing with each repetition. (same) [URL=http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-MouseEvent]MouseEvent[/URL] [URL=http://www.w3.org/TR/SVG/script.html#OnClickEventAttribute]onclick[/URL]
    mousedown Occurs when the pointing device button is pressed over an element. (same) [URL=http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-MouseEvent]MouseEvent[/URL] [URL=http://www.w3.org/TR/SVG/script.html#OnMouseDownEventAttribute]onmousedown[/URL]
    mouseup Occurs when the pointing device button is released over an element. (same) [URL=http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-MouseEvent]MouseEvent[/URL] [URL=http://www.w3.org/TR/SVG/script.html#OnMouseUpEventAttribute]onmouseup[/URL]
    mouseover Occurs when the pointing device is moved onto an element. (same) [URL=http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-MouseEvent]MouseEvent[/URL] [URL=http://www.w3.org/TR/SVG/script.html#OnMouseOverEventAttribute]onmouseover[/URL]
    mousemove Occurs when the pointing device is moved while it is over an element. (same) [URL=http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-MouseEvent]MouseEvent[/URL] [URL=http://www.w3.org/TR/SVG/script.html#OnMouseMoveEventAttribute]onmousemove[/URL]
    mouseout Occurs when the pointing device is moved away from an element. (same) [URL=http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-MouseEvent]MouseEvent[/URL] [URL=http://www.w3.org/TR/SVG/script.html#OnMouseOutEventAttribute]onmouseout[/URL]
    DOMSubtreeModified This is a general event for notification of all changes to the document. It can be used instead of the more specific events listed below. (The normative definition of this event is the description in the [URL=http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-MutationEvent]DOM2 specification[/URL].) (same) [URL=http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-MutationEvent]MutationEvent[/URL] none
    DOMNodeInserted Fired when a node has been added as a child of another node. (The normative definition of this event is the description in the [URL=http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-MutationEvent]DOM2 specification[/URL].) (same) [URL=http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-MutationEvent]MutationEvent[/URL] none
    DOMNodeRemoved Fired when a node is being removed from another node. (The normative definition of this event is the description in the [URL=http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-MutationEvent]DOM2 specification[/URL].) (same) [URL=http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-MutationEvent]MutationEvent[/URL] none
    DOMNodeRemovedFromDocument Fired when a node is being removed from a document, either through direct removal of the Node or removal of a subtree in which it is contained. (The normative definition of this event is the description in the [URL=http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-MutationEvent]DOM2 specification[/URL].) (same) [URL=http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-MutationEvent]MutationEvent[/URL] none
    DOMNodeInsertedIntoDocument Fired when a node is being inserted into a document, either through direct insertion of the Node or insertion of a subtree in which it is contained. (The normative definition of this event is the description in the [URL=http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-MutationEvent]DOM2 specification[/URL].) (same) [URL=http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-MutationEvent]MutationEvent[/URL] none
    DOMAttrModified Fired after an attribute has been modified on a node. (The normative definition of this event is the description in the [URL=http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-MutationEvent]DOM2 specification[/URL].) (same) [URL=http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-MutationEvent]MutationEvent[/URL] none
    DOMCharacterDataModified Fired after CharacterData within a node has been modified but the node itself has not been inserted or deleted. (The normative definition of this event is the description in the [URL=http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-MutationEvent]DOM2 specification[/URL].) (same) [URL=http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-MutationEvent]MutationEvent[/URL] none
    SVGLoad The event is triggered at the point at which the user agent has fully parsed the element and its descendants and is ready to act appropriately upon that element, such as being ready to render the element to the target device. [URL=http://www.w3.org/TR/SVG/struct.html#ExternalResourcesRequired]Referenced external resources that are required[/URL] must be loaded, parsed and ready to render before the event is triggered. Optional external resources are not required to be ready for the event to be triggered. (same) none [URL=http://www.w3.org/TR/SVG/script.html#OnLoadEventAttribute]onload[/URL]
    SVGUnload Only applicable to outermost [URL=http://www.w3.org/TR/SVG/struct.html#SVGElement]'svg'[/URL] elements. The unload event occurs when the DOM implementation removes a document from a window or frame. (same) none [URL=http://www.w3.org/TR/SVG/script.html#OnUnloadEventAttribute]onunload[/URL]
    SVGAbort The abort event occurs when page loading is stopped before an element has been allowed to load completely. (same) none [URL=http://www.w3.org/TR/SVG/script.html#OnAbortEventAttribute]onabort[/URL]
    SVGError The error event occurs when an element does not load properly or when an error occurs during script execution. (same) none [URL=http://www.w3.org/TR/SVG/script.html#OnErrorEventAttribute]onerror[/URL]
    SVGResize Occurs when a document view is being resized. This event is only applicable to outermost [URL=http://www.w3.org/TR/SVG/struct.html#SVGElement]'svg'[/URL] elements and is dispatched after the resize operation has taken place. The target of the event is the [URL=http://www.w3.org/TR/SVG/struct.html#SVGElement]'svg'[/URL] element. (same) none [URL=http://www.w3.org/TR/SVG/script.html#OnResizeEventAttribute]onresize[/URL]
    SVGScroll Occurs when a document view is being shifted along the X or Y or both axis, either through a direct user interaction or any change on the 'currentTranslate' property available on SVGSVGElement interface. This event is only applicable to outermost [URL=http://www.w3.org/TR/SVG/struct.html#SVGElement]'svg'[/URL] elements and is dispatched after the shift modification has taken place. The target of the event is the [URL=http://www.w3.org/TR/SVG/struct.html#SVGElement]'svg'[/URL] element. (same) none [URL=http://www.w3.org/TR/SVG/script.html#OnScrollEventAttribute]onscroll[/URL]
    SVGZoom Occurs when the zoom level of a document view is being changed, either through a direct user interaction or any change to the 'currentScale' property available on SVGSVGElement interface. This event is only applicable to outermost [URL=http://www.w3.org/TR/SVG/struct.html#SVGElement]'svg'[/URL] elements and is dispatched after the zoom level modification has taken place. The target of the event is the [URL=http://www.w3.org/TR/SVG/struct.html#SVGElement]'svg'[/URL] element. none none [URL=http://www.w3.org/TR/SVG/script.html#OnZoomEventAttribute]onzoom[/URL]
    beginEvent Occurs when an animation element begins. For details, see the description of Interface TimeEvent in the [URL=http://www.w3.org/TR/2001/REC-smil-animation-20010904/]SMIL Animation specification[/URL]. none none [URL=http://www.w3.org/TR/SVG/script.html#OnBeginEventAttribute]onbegin[/URL]
    endEvent Occurs when an animation element ends. For details, see the description of Interface TimeEvent in the [URL=http://www.w3.org/TR/2001/REC-smil-animation-20010904/]SMIL Animation specification[/URL]. none none [URL=http://www.w3.org/TR/SVG/script.html#OnEndEventAttribute]onend[/URL]
    repeatEvent Occurs when an animation element repeats. It is raised each time the element repeats, after the first iteration. For details, see the description of Interface TimeEvent in the [URL=http://www.w3.org/TR/2001/REC-smil-animation-20010904/]SMIL Animation specification[/URL]. none none [URL=http://www.w3.org/TR/SVG/script.html#OnRepeatEventAttribute]onrepeat[/URL]

    As in [URL=http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-eventgroupings-keyevents]DOM2 Key events[/URL], the SVG specification does not provide a key event set. An event set designed for use with keyboard input devices will be included in a later version of the DOM and SVG specifications.

    A SVGLoad event is dispatched only to the element to which the event applies; it is not dispatched to its ancestors. For example, if an [URL=http://www.w3.org/TR/SVG/struct.html#ImageElement]'image'[/URL] element and its parent [URL=http://www.w3.org/TR/SVG/struct.html#GElement]'g'[/URL] element both have event listeners for SVGLoad events, when the [URL=http://www.w3.org/TR/SVG/struct.html#ImageElement]'image'[/URL] element has been loaded, only its event listener will be invoked. (The [URL=http://www.w3.org/TR/SVG/struct.html#GElement]'g'[/URL] element's event listener will indeed get invoked, but the invocation will happen when the [URL=http://www.w3.org/TR/SVG/struct.html#GElement]'g'[/URL] itself has been loaded.)

    Details on the parameters passed to event listeners for the event types from DOM2 can be found in the DOM2 specification. For other event types, the parameters passed to event listeners are described elsewhere in this specification.

    16.3 User interface events
    On user agents which support interactivity, it is common for authors to define SVG documents such that they are responsive to user interface events. Among the set of possible user events are [URL=http://www.w3.org/TR/SVG/interact.html#PointerEvents]pointer events[/URL], keyboard events, and document events.

    In response to user interface (UI) events, the author might start an animation, perform a hyperlink to another Web page, highlight part of the document (e.g., change the color of the graphics elements which are under the pointer), initiate a "roll-over" (e.g., cause some previously hidden graphics elements to appear near the pointer) or launch a script which communicates with a remote database.

    For all UI event-related features defined as part of the SVG language via [URL=http://www.w3.org/TR/SVG/script.html#EventAttributes]event attributes[/URL] or [URL=http://www.w3.org/TR/SVG/animate.html]animation[/URL], the event model corresponds to the event bubbling model described in DOM2 [[URL=http://www.w3.org/TR/DOM-Level-2-Events/events.html]DOM2-EVBUBBLE[/URL]]. The event capture model from DOM2 [[URL=http://www.w3.org/TR/DOM-Level-2-Events/events.html]DOM2-EVCAPTURE[/URL]] can only be established from DOM method calls.

    16.4 Pointer events
    User interface events that occur because of user actions performed on a pointer device are called pointer events.

    Many systems support pointer devices such as a mouse or trackball. On systems which use a mouse, pointer events consist of actions such as mouse movements and mouse clicks. On systems with a different pointer device, the pointing device often emulates the behavior of the mouse by providing a mechanism for equivalent user actions, such as a button to press which is equivalent to a mouse click.

    For each pointer event, the SVG user agent determines the target element of a given pointer event. The target element is the topmost graphics element whose relevant graphical content is under the pointer at the time of the event. (See property [URL=http://www.w3.org/TR/SVG/interact.html#PointerEventsProperty]'pointer-events'[/URL] for a description of how to determine whether an element's relevant graphical content is under the pointer, and thus in which circumstances that graphic element can be the target element for a pointer event.) When an element is not displayed (i.e., when the [URL=http://www.w3.org/TR/SVG/painting.html#DisplayProperty]'display'[/URL] property on that element or one of its ancestors has a value of none), that element cannot be the target of pointer events.

    The event is either initially dispatched to the target element, to one of the target element's ancestors, or not dispatched, depending on the following:

    If there are no graphics elements whose relevant graphics content is under the pointer (i.e., there is no target element), the event is not dispatched.
    Otherwise, there is a target element. If there is an ancestor of the target element which has specified an event handler with event capturing [[URL=http://www.w3.org/TR/DOM-Level-2-Events/events.html]DOM2-EVCAPTURE[/URL]] for the given event, then the event is dispatched to that ancestor element.
    Otherwise, if the target element has an appropriate event handler for the given event, the event is dispatched to the target element.
    Otherwise, each ancestor of the target element (starting with its immediate parent) is checked to see if it has an appropriate event handler. If an ancestor is found with an appropriate event handler, the event is dispatched to that ancestor element.
    Otherwise, the event is discarded.
    When event bubbling [[URL=http://www.w3.org/TR/DOM-Level-2-Events/events.html]DOM2-EVBUBBLE[/URL]] is active, bubbling occurs up to all direct ancestors of the target element. Descendant elements receive events before their ancestors. Thus, if a [URL=http://www.w3.org/TR/SVG/paths.html#PathElement]'path'[/URL] element is a child of a [URL=http://www.w3.org/TR/SVG/struct.html#GElement]'g'[/URL] element and they both have event listeners for click events, then the event will be dispatched to the [URL=http://www.w3.org/TR/SVG/paths.html#PathElement]'path'[/URL] element before the [URL=http://www.w3.org/TR/SVG/struct.html#GElement]'g'[/URL] element.

    When event capturing [[URL=http://www.w3.org/TR/DOM-Level-2-Events/events.html]DOM2-EVCAPTURE[/URL]] is active, ancestor elements receive events before their descendants.

    After an event is initially dispatched to a particular element, unless an appropriate action has been taken to prevent further processing (e.g., by invoking the preventCapture() or preventBubble() DOM method call), the event will be passed to the appropriate event handlers (if any) for that element's ancestors (in the case of event bubbling) or that element's descendants (in the case of event capture) for further processing.

    16.5 Processing order for user interface events
    The processing order for user interface events is as follows:

    Event handlers assigned to the topmost graphics element under the pointer (and the various ancestors of that graphics element via potential event bubbling [[URL=http://www.w3.org/TR/DOM-Level-2-Events/events.html]DOM2-EVBUBBLE[/URL]]) receive the event first. If none of the activation event handlers take an explicit action to prevent further processing of the given event (e.g., by invoking the preventDefault() DOM method), then the event is passed on for:
    Processing of any relevant dynamic pseudo-classes (i.e., :hover, :active and :focus) [[URL=http://www.w3.org/TR/REC-CSS2/selector.html#q15]CSS2-DYNPSEUDO[/URL]], after which the event is passed on for:
    (For those user interface events which invoke hyperlinks, such as mouse clicks in some user agents) [URL=http://www.w3.org/TR/SVG/linking.html#Links]Link[/URL] processing. If a hyperlink is invoked in response to a user interface event, the hyperlink typically will disable further activation event processing (e.g., often, the link will define a hyperlink to another Web page). If link processing does not disable further processing of the given event, then the event is passed on for:
    (For those user interface events which can select text, such as mouse clicks and drags on [URL=http://www.w3.org/TR/SVG/text.html#TextElement]'text'[/URL] elements) [URL=http://www.w3.org/TR/SVG/text.html#TextSelection]Text selection[/URL] processing. When a text selection operation occurs, typically it will disable further processing of the given event; otherwise, the event is passed on for:
    Document-wide event processing, such as user agent facilities to allow zooming and panning of an SVG document fragment.


    16.6 The 'pointer-events' property
    In different circumstances, authors may want to control under what circumstances particular graphic elements can become the target of pointer events. For example, the author might want a given element to receive pointer events only when the pointer is over the stroked perimeter of a given shape. In other cases, the author might want a given element to ignore pointer events under all circumstances so that graphical elements underneath the given element will become the target of pointer events.

    For example, suppose a circle with a [URL=http://www.w3.org/TR/SVG/painting.html#StrokeProperty]'stroke'[/URL] of red (i.e., the outline is solid red) and a [URL=http://www.w3.org/TR/SVG/painting.html#FillProperty]'fill'[/URL] of none (i.e., the interior is not painted) is rendered directly on top of a rectangle with a [URL=http://www.w3.org/TR/SVG/painting.html#FillProperty]'fill'[/URL] of blue. The author might want the circle to be the target of pointer events only when the pointer is over the perimeter of the circle. When the pointer is over the interior of the circle, the author might want the underlying rectangle to be the target element of pointer events.

    The 'pointer-events' property specifies under what circumstances a given graphics element can be the target element for a pointer event. It affects the circumstances under which the following are processed:

    user interface events such as mouse clicks
    dynamic pseudo-classes (i.e., :hover, :active and :focus) [[URL=http://www.w3.org/TR/REC-CSS2/selector.html#q15]CSS2-DYNPSEUDO[/URL]]
    hyperlinks (see [URL=http://www.w3.org/TR/SVG/linking.html#Links]Links out of SVG content: the 'a' element[/URL])
    'pointer-events'
    Value:   visiblePainted | visibleFill | visibleStroke | visible |
    painted | fill | stroke | all | none | [URL=http://www.w3.org/TR/REC-CSS2/cascade.html#value-def-inherit]inherit[/URL]
    Initial:   visiblePainted
    Applies to:   [URL=http://www.w3.org/TR/SVG/intro.html#TermGraphicsElement]graphics elements[/URL]
    Inherited:   yes
    Percentages:   N/A
    Media:   visual
    [URL=http://www.w3.org/TR/SVG/animate.html#Animatable]Animatable[/URL]:   yes

    visiblePainted
    The given element can be the target element for pointer events when the [URL=http://www.w3.org/TR/SVG/painting.html#VisibilityProperty]'visibility'[/URL] property is set to visible and when the pointer is over a "painted" area. The pointer is over a painted area if it is over the interior (i.e., fill) of the element and the [URL=http://www.w3.org/TR/SVG/painting.html#FillProperty]'fill'[/URL] property is set to a value other than 'none' or it is over the perimeter (i.e., stroke) of the element and the [URL=http://www.w3.org/TR/SVG/painting.html#StrokeProperty]'stroke'[/URL] property is set to a value other than 'none'.
    visibleFill
    The given element can be the target element for pointer events when the [URL=http://www.w3.org/TR/SVG/painting.html#VisibilityProperty]'visibility'[/URL] property is set to visible and when the pointer is over the interior (i.e., fill) of the element. The value of the [URL=http://www.w3.org/TR/SVG/painting.html#FillProperty]'fill'[/URL] property does not effect event processing.
    visibleStroke
    The given element can be the target element for pointer events when the [URL=http://www.w3.org/TR/SVG/painting.html#VisibilityProperty]'visibility'[/URL] property is set to visible and when the pointer is over the perimeter (i.e., stroke) of the element. The value of the [URL=http://www.w3.org/TR/SVG/painting.html#StrokeProperty]'stroke'[/URL] property does not effect event processing.
    visible
    The given element can be the target element for pointer events when the [URL=http://www.w3.org/TR/SVG/painting.html#VisibilityProperty]'visibility'[/URL] property is set to visible and the pointer is over either the interior (i.e., fill) or the perimeter (i.e., stroke) of the element. The values of the [URL=http://www.w3.org/TR/SVG/painting.html#FillProperty]'fill'[/URL] and [URL=http://www.w3.org/TR/SVG/painting.html#StrokeProperty]'stroke'[/URL] do not effect event processing.
    painted
    The given element can be the target element for pointer events when the pointer is over a "painted" area. The pointer is over a painted area if it is over the interior (i.e., fill) of the element and the [URL=http://www.w3.org/TR/SVG/painting.html#FillProperty]'fill'[/URL] property is set to a value other than 'none' or it is over the perimeter (i.e., stroke) of the element and the [URL=http://www.w3.org/TR/SVG/painting.html#StrokeProperty]'stroke'[/URL] property is set to a value other than 'none'. The value of the [URL=http://www.w3.org/TR/SVG/painting.html#VisibilityProperty]'visibility'[/URL] property does not effect event processing.
    fill
    The given element can be the target element for pointer events when the pointer is over the interior (i.e., fill) of the element. The values of the [URL=http://www.w3.org/TR/SVG/painting.html#FillProperty]'fill'[/URL] and [URL=http://www.w3.org/TR/SVG/painting.html#VisibilityProperty]'visibility'[/URL] properties do not effect event processing.
    stroke
    The given element can be the target element for pointer events when the pointer is over the perimeter (i.e., stroke) of the element. The values of the [URL=http://www.w3.org/TR/SVG/painting.html#StrokeProperty]'stroke'[/URL] and [URL=http://www.w3.org/TR/SVG/painting.html#VisibilityProperty]'visibility'[/URL] properties do not effect event processing.
    all
    The given element can be the target element for pointer events whenever the pointer is over either the interior (i.e., fill) or the perimeter (i.e., stroke) of the element. The values of the [URL=http://www.w3.org/TR/SVG/painting.html#FillProperty]'fill'[/URL], [URL=http://www.w3.org/TR/SVG/painting.html#StrokeProperty]'stroke'[/URL] and [URL=http://www.w3.org/TR/SVG/painting.html#VisibilityProperty]'visibility'[/URL] properties do not effect event processing.
    none
    The given element does not receive pointer events.
    For text elements, hit detection is performed on a character cell basis:

    The value visiblePainted means that the text string can receive events anywhere within the character cell if either the [URL=http://www.w3.org/TR/SVG/painting.html#FillProperty]'fill'[/URL] property is set to a value other than none or the [URL=http://www.w3.org/TR/SVG/painting.html#StrokeProperty]'stroke'[/URL] property is set to a value other than none, with the additional requirement that the [URL=http://www.w3.org/TR/SVG/painting.html#VisibilityProperty]'visibility'[/URL] property is set to visible.
    The values visibleFill, visibleStroke and visible are equivalent and indicate that the text string can receive events anywhere within the character cell if the [URL=http://www.w3.org/TR/SVG/painting.html#VisibilityProperty]'visibility'[/URL] property is set to visible. The values of the [URL=http://www.w3.org/TR/SVG/painting.html#FillProperty]'fill'[/URL] and [URL=http://www.w3.org/TR/SVG/painting.html#StrokeProperty]'stroke'[/URL] properties do not effect event processing.
    The value painted means that the text string can receive events anywhere within the character cell if either the [URL=http://www.w3.org/TR/SVG/painting.html#FillProperty]'fill'[/URL] property is set to a value other than none or the [URL=http://www.w3.org/TR/SVG/painting.html#StrokeProperty]'stroke'[/URL] property is set to a value other than none. The value of the [URL=http://www.w3.org/TR/SVG/painting.html#VisibilityProperty]'visibility'[/URL] property does not effect event processing.
    The values fill, stroke and all are equivalent and indicate that the text string can receive events anywhere within the character cell. The values of the [URL=http://www.w3.org/TR/SVG/painting.html#FillProperty]'fill'[/URL], [URL=http://www.w3.org/TR/SVG/painting.html#StrokeProperty]'stroke'[/URL] and [URL=http://www.w3.org/TR/SVG/painting.html#VisibilityProperty]'visibility'[/URL] properties do not effect event processing.
    The value none indicates that the given text does not receive pointer events.
    For raster images, hit detection is either performed on a whole-image basis (i.e., the rectangular area for the image is one of the determinants for whether the image receives the event) or on a per-pixel basic (i.e., the alpha values for pixels under the pointer help determine whether the image receives the event):

    The value visiblePainted means that the raster image can receive events anywhere within the bounds of the image if any pixel from the raster image which is under the pointer is not fully transparent, with the additional requirement that the [URL=http://www.w3.org/TR/SVG/painting.html#VisibilityProperty]'visibility'[/URL] property is set to visible.
    The values visibleFill, visibleStroke and visible are equivalent and indicate that the image can receive events anywhere within the rectangular area for the image if the [URL=http://www.w3.org/TR/SVG/painting.html#VisibilityProperty]'visibility'[/URL] property is set to visible.
    The value painted means that the raster image can receive events anywhere within the bounds of the image if any pixel from the raster image which is under the pointer is not fully transparent. The value of the [URL=http://www.w3.org/TR/SVG/painting.html#VisibilityProperty]'visibility'[/URL] property does not effect event processing.
    The values fill, stroke and all are equivalent and indicate that the image can receive events anywhere within the rectangular area for the image. The value of the [URL=http://www.w3.org/TR/SVG/painting.html#VisibilityProperty]'visibility'[/URL] property does not effect event processing.
    The value none indicates that the image does not receive pointer events.
    Note that for raster images, the values of properties [URL=http://www.w3.org/TR/SVG/masking.html#OpacityProperty]'opacity'[/URL], [URL=http://www.w3.org/TR/SVG/painting.html#FillOpacityProperty]'fill-opacity'[/URL], [URL=http://www.w3.org/TR/SVG/painting.html#StrokeOpacityProperty]'stroke-opacity'[/URL], [URL=http://www.w3.org/TR/SVG/painting.html#FillProperty]'fill'[/URL] and [URL=http://www.w3.org/TR/SVG/painting.html#StrokeProperty]'stroke'[/URL] do not effect event processing.

    16.7 Magnification and panning
    Magnification represents a complete, uniform transformation on an SVG document fragment, where the magnify operation scales all graphical elements by the same amount. A magnify operation has the effect of a supplemental scale and translate transformation placed at the outermost level on the SVG document fragment (i.e., outside the outermost [URL=http://www.w3.org/TR/SVG/struct.html#SVGElement]'svg'[/URL] element).

    Panning represents a translation (i.e., a shift) transformation on an SVG document fragment in response to a user interface action.

    SVG user agents that operate in interaction-capable user environments are required to support the ability to magnify and pan.

    The outermost 'svg' element in an SVG document fragment has attribute zoomAndPan, which takes the possible values of disable and magnify, with the default being magnify.

    If disable, the user agent shall disable any magnification and panning controls and not allow the user to magnify or pan on the given document fragment.

    If magnify, in environments that support user interactivity, the user agent shall provide controls to allow the user to perform a "magnify" operation on the document fragment.

    If a zoomAndPan attribute is assigned to an inner 'svg' element, the zoomAndPan setting on the inner 'svg' element will have no effect on the SVG user agent.

    [URL=http://www.w3.org/TR/SVG/animate.html#Animatable]Animatable[/URL]: no.

    16.8 Cursors
    16.8.1 Introduction to cursors
    Some interactive display environments provide the ability to modify the appearance of the pointer, which is also known as the cursor. Three types of cursors are available:

    Standard built-in cursors
    Platform-specific custom cursors
    Platform-independent custom cursors
    The [URL=http://www.w3.org/TR/SVG/interact.html#CursorProperty]'cursor'[/URL] property is used to specify which cursor to use. The 'cursor' property can be used to reference standard built-in cursors by specifying a keyword such as crosshair or a custom cursor. Custom cursors are referenced via a <uri> and can point to either an external resource such as a platform-specific cursor file or to a [URL=http://www.w3.org/TR/SVG/interact.html#CursorElement]'cursor'[/URL] element, which can be used to define a platform-independent cursor.

    16.8.2 The 'cursor' property
    'cursor'
    Value:   [ [[URL=http://www.w3.org/TR/SVG/types.html#DataTypeURI]<uri>[/URL] ,]* [ auto | crosshair | default | pointer | move | e-resize | ne-resize | nw-resize | n-resize | se-resize | sw-resize | s-resize | w-resize| text | wait | help ] ] | [URL=http://www.w3.org/TR/REC-CSS2/cascade.html#value-def-inherit]inherit[/URL]
    Initial:   auto
    Applies to:   [URL=http://www.w3.org/TR/SVG/intro.html#TermContainerElement]container elements[/URL] and [URL=http://www.w3.org/TR/SVG/intro.html#TermGraphicsElement]graphics elements[/URL]
    Inherited:   yes
    Percentages:   N/A
    Media:   visual, interactive
    [URL=http://www.w3.org/TR/SVG/animate.html#Animatable]Animatable[/URL]:   yes

    This property specifies the type of cursor to be displayed for the pointing device. Values have the following meanings:

    auto
    The UA determines the cursor to display based on the current context.
    crosshair
    A simple crosshair (e.g., short line segments resembling a "+" sign).
    default
    The platform-dependent default cursor. Often rendered as an arrow.
    pointer
    The cursor is a pointer that indicates a link.
    move
    Indicates something is to be moved.
    e-resize, ne-resize, nw-resize, n-resize, se-resize, sw-resize, s-resize, w-resize
    Indicate that some edge is to be moved. For example, the 'se-resize' cursor is used when the movement starts from the south-east corner of the box.
    text
    Indicates text that can be selected. Often rendered as an I-bar.
    wait
    Indicates that the program is busy. Often rendered as a watch or hourglass.
    help
    Help is available for the object under the cursor. Often rendered as a question mark or a balloon.
    <uri>
    The user agent retrieves the cursor from the resource designated by the URI. If the user agent cannot handle the first cursor of a list of cursors, it shall attempt to handle the second, etc. If the user agent cannot handle any user-defined cursor, it must use the generic cursor at the end of the list.
    P { cursor : url("mything.cur"), url("second.csr"), text; }

    The 'cursor' property for SVG is identical to the 'cursor' property defined in the "Cascading Style Sheets (CSS) level 2" specification [[URL=http://www.w3.org/TR/REC-CSS2/]CSS2[/URL]], with the exception that SVG user agents must support cursors defined by the [URL=http://www.w3.org/TR/SVG/interact.html#CursorElement]'cursor'[/URL] element.

    16.8.3 The 'cursor' element
    The 'cursor' element can be used to define a platform-independent custom cursor. A recommended approach for defining a platform-independent custom cursor is to create a PNG [[URL=http://www.w3.org/TR/REC-png-multi.html]PNG01[/URL]] image and define a 'cursor' element that references the PNG image and identifies the exact position within the image which is the pointer position (i.e., the hot spot).

    The PNG format is recommended because it supports the ability to define a transparency mask via an alpha channel. If a different image format is used, this format should support the definition of a transparency mask (two options: provide an explicit alpha channel or use a particular pixel color to indicate transparency). If the transparency mask can be determined, the mask defines the shape of the cursor; otherwise, the cursor is an opaque rectangle. Typically, the other pixel information (e.g., the R, G and B channels) defines the colors for those parts of the cursor which are not masked out. Note that cursors usually contain at least two colors so that the cursor can be visible over most backgrounds.


      <!ENTITY % SVG.cursor.extra.content "" >
    <!ENTITY % SVG.cursor.element "INCLUDE" >
    <![%SVG.cursor.element;[
    <!ENTITY % SVG.cursor.content
        "( %[URL=http://www.w3.org/TR/SVG/struct.html#id5181053]SVG.Description.class[/URL]; %SVG.cursor.extra.content; )*\
    "
    >
    <!ELEMENT %[URL=http://www.w3.org/TR/SVG/interact.html#CursorElement]SVG.cursor.qname[/URL]; %SVG.cursor.content; >
    <!-- end of SVG.cursor.element -->]]>
    <!ENTITY % SVG.cursor.attlist "INCLUDE" >
    <![%SVG.cursor.attlist;[
    <!ATTLIST %[URL=http://www.w3.org/TR/SVG/interact.html#CursorElement]SVG.cursor.qname[/URL];
        %[URL=http://www.w3.org/TR/SVG/struct.html#core-att-mod]SVG.Core.attrib[/URL];
        %[URL=http://www.w3.org/TR/SVG/struct.html#id5190560]SVG.Conditional.attrib[/URL];
        %[URL=http://www.w3.org/TR/SVG/linking.html#xlink-att-mod]SVG.XLinkRequired.attrib[/URL];
        %[URL=http://www.w3.org/TR/SVG/linking.html#err-att-mod]SVG.External.attrib[/URL];
        x %[URL=http://www.w3.org/TR/SVG/types.html#DataTypeCoordinate]Coordinate.datatype[/URL]; #IMPLIED
        y %[URL=http://www.w3.org/TR/SVG/types.html#DataTypeCoordinate]Coordinate.datatype[/URL]; #IMPLIED
    >

    Attribute definitions:

    x = "[URL=http://www.w3.org/TR/SVG/types.html#DataTypeCoordinate]<coordinate>[/URL]"
    The x-coordinate of the position in the cursor's coordinate system which represents the precise position that is being pointed to.
    If the attribute is not specified, the effect is as if a value of "0" were specified.
    [URL=http://www.w3.org/TR/SVG/animate.html#Animatable]Animatable[/URL]: yes.
    y = "[URL=http://www.w3.org/TR/SVG/types.html#DataTypeCoordinate]<coordinate>[/URL]"
    The y-coordinate of the position in the cursor's coordinate system which represents the precise position that is being pointed to.
    If the attribute is not specified, the effect is as if a value of "0" were specified.
    [URL=http://www.w3.org/TR/SVG/animate.html#Animatable]Animatable[/URL]: yes.
    xlink:href = "[URL=http://www.w3.org/TR/SVG/types.html#DataTypeURI]<uri>[/URL]"
    A [URL=http://www.w3.org/TR/SVG/struct.html#uriReferenceDefinition]URI reference[/URL] to the file or element which provides the image of the cursor.
    [URL=http://www.w3.org/TR/SVG/animate.html#Animatable]Animatable[/URL]: yes.


    SVG user agents are required to support PNG format images as targets of the xlink:href property.


    16.9 Document Events Attribute Module
    The Document Events Attribute Module defines the DocumentEvents.attrib attribute set.

    Collection Name Attributes in Collection
    DocumentEvents.attrib onunload, onabort, onerror, onresize, onscroll, onzoom

    16.10 Graphical Element Events Attribute Module
    The Graphical Element Events Attribute Module defines the GraphicalEvents.attrib attribute set.

    Collection Name Attributes in Collection
    GraphicalEvents.attrib onfocusin, onfocusout, onactivate, onclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onload

    16.11 Animation Events Attribute Module
    The Animation Events Attribute Module defines the AnimationEvents.attrib attribute set.

    Collection Name Attributes in Collection
    AnimationEvents.attrib onbegin, onend, onrepeat, onload

    16.12 Cursor Module
    Elements Attributes Content Model
    cursor Core.attrib, XLinkRequired.attrib, Conditional.attrib, External.attrib, x, y (Description.class)

    16.12.1 Cursor Content Set
    The Cursor Module defines the Cursor.class content set.

    Content Set Name Elements in Content Set
    Cursor.class cursor

    16.12.2 Cursor Attribute Set
    The Cursor Module defines the Cursor.attrib attribute set.

    Collection Name Attributes in Collection
    Cursor.attrib cursor


    16.13 DOM interfaces
    The following interfaces are defined below: [URL=http://www.w3.org/TR/SVG/interact.html#InterfaceSVGCursorElement]SVGCursorElement[/URL].

    Interface SVGCursorElement
    The SVGCursorElement interface corresponds to the 'cursor' element.


    IDL Definition
    interface SVGCursorElement :
                    SVGElement,
                    SVGURIReference,
                    SVGTests,
                    SVGExternalResourcesRequired {
      readonly attribute SVGAnimatedLength x;
      readonly attribute SVGAnimatedLength y;
    };

    Attributes
    readonly SVGAnimatedLength x
    Corresponds to attribute x on the given 'cursor' element.
    readonly SVGAnimatedLength y
    Corresponds to attribute y on the given 'cursor' element.

    --------------------------------------------------------------------------------

    [URL=http://www.w3.org/TR/SVG/filters.html]previous[/URL]   [URL=http://www.w3.org/TR/SVG/linking.html]next[/URL]   [URL=http://www.w3.org/TR/SVG/index.html#minitoc]contents[/URL]   [URL=http://www.w3.org/TR/SVG/eltindex.html]elements[/URL]   [URL=http://www.w3.org/TR/SVG/attindex.html]attributes[/URL]   [URL=http://www.w3.org/TR/SVG/propidx.html]properties[/URL]   [URL=http://www.w3.org/TR/SVG/indexlist.html]index[/URL]

    ----------------------------------------------

    -----------------------------------------------

    第十二章第一节《用ROR创建面向资源的服务》
    第十二章第二节《用Restlet创建面向资源的服务》
    第三章《REST式服务有什么不同》
    InfoQ SOA首席编辑胡键评《RESTful Web Services中文版》
    [InfoQ文章]解答有关REST的十点疑惑

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2004/8/11 21:54:00
     
     GoogleAdSense
      
      
      等级:大一新生
      文章:1
      积分:50
      门派:无门无派
      院校:未填写
      注册:2007-01-01
    给Google AdSense发送一个短消息 把Google AdSense加入好友 查看Google AdSense的个人资料 搜索Google AdSense在『 SVG/GML/VRML/X3D/XAML 』的所有贴子 点击这里发送电邮给Google AdSense  访问Google AdSense的主页 引用回复这个贴子 回复这个贴子 查看Google AdSense的博客广告
    2024/5/5 1:43:52

    本主题贴数2,分页: [1]

    管理选项修改tag | 锁定 | 解锁 | 提升 | 删除 | 移动 | 固顶 | 总固顶 | 奖励 | 惩罚 | 发布公告
    W3C Contributing Supporter! W 3 C h i n a ( since 2003 ) 旗 下 站 点
    苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
    113.281ms