I want to overlay a div over the viewport when the user drags a file onto the window. However, I’m having trouble with the event propagation. When I set the overlay to display: block it appears to fire off a dragleave event and then another dragenter and then another dragleave again, so it’s always in a post-dragleave state. Of course
Tag: css
Select box truncating text when body font size changed via javascript on document ready in IE 9
IE 9 is behaving quite strangely for me. I’ve got a page font-size changing control that saves the users setting and then in the document ready sets the body font-size to that size. It works fine, the issue is, when a page with dropdowns loads, in IE 9, sometimes the text is cut off. I’ve simplified the code down to
Use CMYK on web page
I need to use CMYK colors on my web page. Is there any way to use CMYK in CSS or may be convert CMYK to RGB using JavaScript? EDIT: I mean I have colors creating algorithm in CMYK notation and I need to use it on web page. Answer There is no perfect algorithmic way to convert CMYK to RGB.
Facebook Like button causing horizontal scrolling on mobile device
I have a Facebook Like button implementation which is rendering fine in all browsers desktop and mobile. But the issues lies on low-res devices with resolution of 240×320. the Like button is causing the device to zoom into the page thus rendering horizontal scrolling. The buttons is rendering fine on devices with width >= 320px like the iPhone etc., but
Toggle display:none style with JavaScript
I want to change the style (second line below) to remove the display: none; part when the user clicks on the “Show All Tags” link. If the user clicks the “Show All Tags” link again, I need the display: none; text added back in to the “style…” statement. I’ve searched here and Google for an example I can apply to
How to make a text flash in html/javascript?
I know flashing text is banned at many places but still as my client requires it, I need to flash one line of text using HTML, JavaScript which ever is feasible. I would like the text to appear and disappear within seconds and continue this cycle. I know text-decoration:blink in CSS can do this but it only works in FireFox,
JavaScript test if a CSS stylesheet is applied with CSS3 media query
I have two style sheets: The second one should only be loaded when the window is 800px or wider (narrower displays get a layout more appropriate for mobile devices). The JavaScript needs to know if that second style sheet is being applied, I have tried the jQuery: But when you get around the 790 – 810px width, Chrome/Firefox (and probably
How to find the height of an element that is not displayed
I’m writing a webpage that has a table with rows that slide open and closed. Initially, some rows are closed (display: none), and I want them to slide open. Setting the height and using overflow: hidden doesn’t work on table rows, so I’m changing the height of a div inside the table. This works. The only problem is that I
Only detect click event on pseudo-element
Please see this fiddle: http://jsfiddle.net/ZWw3Z/5/ My code is: I would like to trigger a click event only on the pseudo-element (the red bit). That is, I don’t want the click event to be triggered on the blue bit. Answer This is not possible; pseudo-elements are not part of the DOM at all so you can’t bind any events directly to
Is it possible to alter a CSS stylesheet using JavaScript? (NOT the style of an object, but the stylesheet itself)
Is it possible to alter a CSS stylesheet using JavaScript? I am NOT talking about: I AM talking about altering: besides doing something dirty (which we haven’t tried yet btw), like creating a new object in the head, innerHTML a style tag in there, etc. Although this, even if it did work, would pose a few issues as the style