IE and Firefox compatibility issues _ Experience Exchange

Source: Internet
Author: User
Window.event

IE: There are window.event objects
FF: No Window.event object. You can pass an event object to a function's arguments. such as Onmousemove=domousemove (event)
Current mouse coordinates

Ie:event.x and Event.y.
FF:event.pageX and Event.pagey.
Generic: Both have Event.clientx and Event.clienty properties.
The current coordinates of the mouse (plus the distance that the scroll bars are rolled over)

IE:event.offsetX and Event.offsety.
FF:event.layerX and Event.layery.
coordinates of X and y of the label: Style.posleft and Style.postop

IE: there is.
FF: No.
General: Object.offsetleft and Object.offsettop.
The height and width of the form

IE:document.body.offsetWidth and Document.body.offsetHeight. Note: This page must have a body tag.
FF:window.innerWidth and Window.innerhegiht, as well as Document.documentElement.clientWidth and document.documentElement.clientHeight.
General: Document.body.clientWidth and Document.body.clientHeight.
Add Event

IE:element.attachEvent ("onclick", func);.
FF:element.addEventListener ("Click", Func, True).
General: Element.onclick=func. Although you can use the OnClick event, the effect of the onclick and the above two methods is different, and the onclick only executes a process, and attachevent and AddEventListener perform a list of processes, that is, multiple processes. For example: Element.attachevent ("onclick", func1), Element.attachevent ("onclick", Func2) such func1 and FUNC2 will be executed.
Custom Properties for labels

IE: If you define a property value for the tag div1, you can div1.value and div1["value" to get the value.
FF: cannot be taken with Div1.value and div1["value").
Generic: Div1.getattribute ("value").
Parent node, child node, and delete node

Ie:parentelement, Parement.children,element.romovenode (true).
Ff:parentnode, Parentnode.childnodes,node.parentnode.removechild (node).
Drawing

Ie:vml.
Ff:svg.
CSS: Transparent

IE:filter:progid:DXImageTransform.Microsoft.Alpha (style=0,opacity=60).
ff:opacity:0.6.
CSS: Rounded Corners

IE: Rounded corners are not supported.
FF:-MOZ-BORDER-RADIUS:4PX, or-moz-border-radius-topleft:4px;-moz-border-radius-topright:4px;-. moz-border-radius-bottomleft:4px;-moz-border-radius-bottomright:4px;.
CSS: Double-line bump border

ie:border:2px outset;.
Ff:-moz-border-top-colors: #d4d0c8 white;-moz-border-left-colors: #d4d0c8 white;-moz-border-right-colors: #404040 # 808080;-moz-border-bottom-colors: #404040 #808080;.
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.