| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
|
Thanks for the reply. If the required action is simply to call execCommand, the onClick event seems to work fine. Note that in my case the html text is in an iframe. The buttons are on the main window. But for more complex scripts that need to work on selections and ranges, unless I have done something wrong, it seems that the properties of the selection returned by the getSelection() method are wrong. These properties are identified in another thread of this list. For example, I have been unable to build the range corresponding to a simple text selection using the following sequence: var sel = window.getSelection(); var range = document.createRange(); range.setStart(sel.baseNode, sel.baseOffset); range.setEnd(sel.extentNode, sel.extentOffset); I have seen no difference from within the onMouseDown event. Stanislas mark malone a écrit : Using onMouseDown instead of onClick allows you to get the event and call the appropriate execCommand value before the selection is lost. |
_______________________________________________ Do not post admin requests to the list. They will be ignored. Webcore-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webcore-dev/email@hidden This email sent to email@hidden
| References: | |
| >Re: Selection is lost when button is clicked in Safari 1.3 (From: mark malone <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.