What are -moz- and -webkit-? [duplicate]

This question already has answers here: Why do browsers create vendor prefixes for CSS properties? (2 answers) Closed 2 years ago. -webkit-column-count: 3; -webkit-column-gap: 10px; -webkit-column-fill: auto; -moz-column-count: 3; -moz-column-gap: 10px; -moz-column-fill: auto; I am a beginner at CSS and when I was looking at some CSS code the other day, I found these lines. … Read more

Detect rotation of Android phone in the browser with JavaScript

I know that in Safari on an iPhone you can detect the screen’s orientation and change of orientation by listening for the onorientationchange event and querying window.orientation for the angle. Is this possible in the browser on Android phones? To be clear, I am asking whether the rotation of an Android device can be detected … Read more

Video auto play is not working in Safari and Chrome desktop browser

I spent quite a lot of time trying to figure out why video embedded like here: <video height=”256″ loop autoplay muted controls id=”vid”> <source type=”video/mp4″ src=”https://stackoverflow.com/questions/17994666/video_file.mp4″></source> <source type=”video/ogg” src=”video_file.ogg”></source> </video> starts playing automatically once the page is loaded in FireFox but cannot do autoplay in Webkit based browsers. This only happened on some random pages. … Read more

Disable webkit’s spin buttons on input type=”number”?

I have a site which is primarily for mobile users but desktop too. On Mobile Safari, using <input type=”number”> works great because it brings up the numerical keyboard on input fields which should only contain numbers. In Chrome and Safari however, using number inputs displays spin buttons at the right side of the field, which … Read more

css3 transition animation on load?

Is it possible to use CSS3 transition animation on page load without using Javascript? This is kind of what I want, but on page load: http://rilwis.googlecode.com/svn/trunk/demo/image-slider.html What I found so far CSS3 transition-delay, a way to delay effects on elements. Only works on hover. CSS3 Keyframe, works on load but are extremly slow. Not useful … Read more

How can I force WebKit to redraw/repaint to propagate style changes?

I have some trivial JavaScript to effect a style change: sel = document.getElementById(‘my_id’); sel.className = sel.className.replace(/item-[1-9]-selected/,’item-1-selected’); return false; This works fine with the latest versions of FF, Opera and IE, but fails on the latest versions of Chrome and Safari. It affects two descendants, which happen to be siblings. The first sibling updates, but the … Read more

Background color not showing in print preview

I am trying to print a page. In that page I have given a table a background color. When I view the print preview in chrome its not taking on the background color property… So I tried this property: -webkit-print-color-adjust: exact; but still its not showing the color. http://jsfiddle.net/TbrtD/ .vendorListHeading { background-color: #1a4567; color: white; … Read more

JavaScript: Is there a way to get Chrome to break on all errors?

I am looking for an equivalent in Chrome to the “break on all errors” functionality of Firebug. In the Scripts tab, Chrome has a “pause on all exceptions”, but this is not quite the same as breaking on all errors. For instance, when loading a page with the following code, I would like Chrome to … Read more

Get the real width and height of an image with JavaScript? (in Safari/Chrome)

I am creating a jQuery plugin. How do I get the real image width and height with Javascript in Safari? The following works with Firefox 3, IE7 and Opera 9: var pic = $(“img”) // need to remove these in of case img-element has set width and height pic.removeAttr(“width”); pic.removeAttr(“height”); var pic_real_width = pic.width(); var … Read more