cross-browser

Can I get consistent CSS colors across browsers?

橙三吉。 提交于 2019-12-04 17:53:18
I'm testing a new site, and I have a div with background-color: #bbf6bb; That seems innocuous enough to me. And yet, on my MacBook Pro, the color looks very different in Firefox 3.6 vs. Safari 4. In Safari, it's the color I'd expect from the hex value: a pale green. In Firefox, there's a definite bluish tint, making the color turquoise. I'm aware of color inconsistencies that result from different treatment of images across browsers, but in pure CSS? Really? I'm guessing that Firefox trying to correct for my display in hopes of delivering better consistency with print, but I'd much rather have

Unexpected performace.navigation.type onbeforeunload

为君一笑 提交于 2019-12-04 17:48:59
I'm trying to handle some logic on before unload and I don't want that logic to run if the user is reloading the page or going back. I've set up something like this. window.onbeforeunload = function(e) { if(window.event && window.event.clientX){ //IE //some logic } else if (e.currentTarget.performance.navigation.type === e.currentTarget.performance.navigation.TYPE_RELOAD) { // another logic } else if(e.currentTarget.performance.navigation.type === e.currentTarget.performance.navigation.TYPE_BACK_FORWARD){ // yet another logic } } I have other code to handle refresh and such from keyboard input

Do html5 data attributes need a value? [duplicate]

限于喜欢 提交于 2019-12-04 17:35:35
问题 This question already has answers here : Are empty HTML5 data attributes valid? (4 answers) Closed 4 years ago . I am wondering if html data attributes actually need a value to be applied? I wonder this because often all we want to know is if the attribute is actually set to act as a flag. (sure we could use a class for this; but realistically unless you are going to style these items differently then the flags are more data than a semantic item). A perfect example of this is if we want a

How can i clone an image in javascript

懵懂的女人 提交于 2019-12-04 17:30:20
问题 I'm trying to clone an image in javascript, bud without loading a new one. Normally new browsers will load an image once and there are several ways to use that image again. The problem is that when I test it in IE 6 the image will request a new image from the server. Anyone how has some info on how to do this in older browsers? 3 methods that not work: <html> <head> <title>My Image Cloning</title> <script type="text/javascript"> sourceImage = new Image(); sourceImage.src = "myImage.png";

Save me from IE6

一世执手 提交于 2019-12-04 16:19:59
问题 I'm getting ready to start work on a new web project for a fairly large corporation. For all their users, something like 17,000 people, they are all stuck with IE6. They plan to have everyone transitioned to IE7 by the end of the year, however the IT department is starting to push this promise back. What I've been asked to do is to give the project sponsor some more ammo push back on this. However, my charismatic politician button seems to be broken. I've only been unable to come up with

window.devicePixelRatio browser support

天涯浪子 提交于 2019-12-04 16:07:01
问题 I have been looking around the web to find what browser support there is for window.devicePixelRatio , without much luck. Does anyone know what browers/devices support this? 回答1: According to this blog post : ( from 2012 ) window.devicePixelRatio is mostly trustworthy on most browsers. On iOS devices, multiply devicePixelRatio by screen.width to get the physical pixel count. On Android and Windows Phone devices, divide screen.width by devicePixelRatio to get the dips count. 2017 UPDATE: This

Vertically aligning floated DIVs with varying heights?

对着背影说爱祢 提交于 2019-12-04 16:06:36
See my JSfiddle to see what currently happens I have some divs with content of varying height. The width is always the same. Each row should contain two columns, but I would like the start of each div in a row to be at the same height. Contrast this to say the jQuery Masonry plugin, where all the "bricks" are squeezed together to remove spaces. What's a good, cross-browser way to achieve this? My idea was to clear the float for every 2nd nth child, but I believe IE doesn't support this? I believe I could also do something with jQuery, but is it tidy? Will I have learnt anything in order to fix

Uncaught SyntaxError: Failed to execute 'postMessage' on 'Window': Invalid target origin 'my_page' in a call to 'postMessage'

早过忘川 提交于 2019-12-04 16:06:00
问题 i have following script Parent Page(pair_pixel_filter.php): window.addEventListener("message", function(e) { $('#log').append("Received message: " + (e.data)); }, false); $('.photo-upload-btn').click(function(event) { event.preventDefault(); window.open($(this).attr("href"), "popupWindow", "width=600,height=600,scrollbars=yes"); }); The Child Page $.ajax({ type: 'post', url: url, data: { base64data: dataURL }, success: function(data) { window.opener.postMessage(data, "pair_pixel_filter.php");

Finding the client's timezone and culture via web service

无人久伴 提交于 2019-12-04 15:50:37
I have a .NET web service. It serves AJAX requests from web users. I would simply like to know how to automatically get the user's timezone... Not current time offset, but the actual timezone - like, Central Standard Time is -5:00 right now, but Eastern Standard Time will be -5:00 once daylight savings is over. I want to differentiate these users. I would also like to know how to get their culture settings ("en-US", etc.) so I can render DateTimes and numbers from my web service to their specific preferences. Any Javascript or .NET solution will work. Thanks. Note: Asking the user would be a

How to make the web site design more flexible

荒凉一梦 提交于 2019-12-04 15:14:11
I wanna to ask the following question about the design of any web application. When maximizing ,, minimizing , zooming the browser ,, i note many problems happen to my web application design for example the horizontal menu like the one exists in SO site when minimizing the window the items of the menu in my website go down the other .. and other things make the site sucks and distracts the design .. how to make the design more flexible with the changes in monitor size , the preferences of the browser , maximizing ,and minimizing the browser ,, how to make the site design more flexible about