Skip to content
Advertisement

Tag: css

Event propagation, overlay and drag-and-drop events

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

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.

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

Advertisement