cross-browser

How to scroll to element cross browser using jquery animate

佐手、 提交于 2019-12-07 15:26:21
问题 This code: jQuery('body').animate({scrollTop: target.offset().top}, 300); Works in firefox, but not chrome. This code: jQuery('html').animate({scrollTop: target.offset().top}, 300); Works in chrome, but not firefox. I haven't tested yet in IE. What is the correct way to do this, cross-browser? If it's not clear from the above snippets, I target is a div on the page, and I want to scroll down slowly to it slowly, so they do exactly what I want... just not cross-browser. 回答1: Specify both html

HTML email doesn't display correctly in Google Apps/Gmail

倖福魔咒の 提交于 2019-12-07 15:22:30
问题 My web application sends HTML-based e-mail to users. I've created a HTML e-mail template (based off a template provided by MailChimp which is supposedly designed to work in any browser/email client). When I send it using SendGrid , it arrives and displays perfectly on my Apple iPhone 4 but doesn't display correctly when I test it in Gmail/Google Apps (using both Firefox and Google Chrome) . The HTML code snippet that isn't working properly: <tr> <td align="center" valign="top" style="padding

Internet Explorer Javascript/ Dom Object add rows problem

穿精又带淫゛_ 提交于 2019-12-07 15:13:34
Here is my Javascript code : function generate(choice) { if(choice==1) { charge++; var new_row=document.createElement("tr"); var name="row"+charge; new_row.setAttribute("name",name); new_row.setAttribute("id",name); var col1=document.createElement("td"); var col2=document.createElement("td"); var col3=document.createElement("td"); var col4=document.createElement("td"); col1.setAttribute("width","205"); col2.setAttribute("width","191"); col3.setAttribute("width","182"); col4.setAttribute("width","127"); var list1=document.getElementById("rep0").cloneNode(true); id="rep"+charge; list1

CSS line-height issue across browsers

自古美人都是妖i 提交于 2019-12-07 14:21:15
问题 I have some button controls with CSS line-height: 18px. Some are input controls type="button", and others are anchors stylized to appear as buttons like the input controls. In FF3.6.12/IE8 they are displaying the same height, but in IE7, the anchors are shorter in height. How do I get them to display correctly in IE7? 回答1: I took your demo: http://jsfiddle.net/DnGvF/ and added just this CSS at the end: http://jsfiddle.net/gRF9g/ /* ie7 fixes */ .Footer input[type=button], .Footer input[type

Does the “overflow-y: scroll” property help prevent horizontal shift in Opera/Safari?

别说谁变了你拦得住时间么 提交于 2019-12-07 14:11:53
问题 I'm using the following in my CSS to force a vertical scrollbar in Firefox: body { overflow-y: scroll; } Does this technique work in Safari and Opera? Some people say it does and some say otherwise. 回答1: The CSS rule overflow-y: scroll works for me in: Opera 10.10 Google Chrome 3.0.195.38 Mozilla Firefox 3.5.6 and obviously all versions of Microsoft Internet Explorer where the scrollbar is always shown. Safari and Google Chrome are using the same view engine, so chances are it works in Safari

XML to XML transformation with XSLT in Firefox and IE

给你一囗甜甜゛ 提交于 2019-12-07 14:03:01
问题 I did a transformation from few XML formats to one standard. My XSL looks like following one: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output method="xml" encoding="UTF-8" indent="yes" omit-xml-declaration="yes"/> <xsl:template match="list | store"> <list> <xsl:for-each select="item | product | product-store"> <item> <name> <xsl:choose> <xsl:when test="name"><xsl:value-of select="substring-before(name, ' ')" />

Top window's URL form inside of multiple nested cross-domain iFrames

倾然丶 夕夏残阳落幕 提交于 2019-12-07 13:55:10
问题 My content (including JS) is served in an iFrame that is then encapsulated in middleman's (distributor) iFrame that is then loaded by a publisher into his website. All 3 frames are served from different domains (cross-domain). I need to identify the URL of the top frame (URL of the website) from within my iFrame. But I can only execute my JS in my iFrame, the middle man or the website publisher are unaffiliated, I can not ask them to put any script or in any way modify the source code of the

HP QTP 11: Script execution fails when running in Firefox, but Debug Viewer shows result of operation

不问归期 提交于 2019-12-07 13:10:52
问题 I'm trying to run our automation, written for IE, on Firefox 3.6 and facing those frustrating problem: I have a code: Set cellDataItems = Browser().Page().WebElement().Object.getElementsByTagName("div") For i = 0 to cellDataItems.length -1 MsgBox (cellDataItems.item(i).innerHTML) Next When script goes to line with MsgBox if stops with error: TypeError: obj[FuncName] is undefined Then I press debug, see that i=0. I added cellDataItems.item(i).innerHTML into debug viewer, it shows it's value

jQuery animation issue in Chrome

橙三吉。 提交于 2019-12-07 12:18:03
问题 I was animating an a element in jQuery using jQuery 1.3.2 and jQuery color plugin. I was animating the 'color' and 'backgroundColor' properties at the same time. In IE8 and FF it worked just fine. Chrome animated the mousehover color and then stopped. The background stayed the same and the mouseout did not undo the effect as it should have. Chrome's developer tools said something about something being undefined. I know that I'm being somewhat vague here, perhaps this is a known issue? EDIT -

Show me a Javascript implementation of webkitConvertPointFromPageToNode

旧巷老猫 提交于 2019-12-07 10:22:19
问题 The webkitConvertPointFromPageToNode(in Node node, in WebKitPoint p) method is awesome; give it a DOM node and a point in page-coordinates (say, the mouse cursor position) and it will give a coordinate back to you in that node's local coordinate system. Unfortunately, it's currently only available in webkit. # Choose a node into which we'll map the mouse coordinates node = $('#subjectElement').get(0) handleMouseMove = (e) -> # Convert the mouse position to a Point mousePoint = new WebKitPoint