I have html page with frame where I want to show some web pages/sites. There are some sites like www.yandex.com which popup from frame and become main window. I want to find some solution to intercept some event or something like this to prevent such subframe activity. Is it possible? Answer You can listen to the onbeforeunload event, which fires
Tag: css
HTML5 Video – Percentage Loaded?
Does anyone know what event or property I need to query in order to get a percentage figure of the amount an HTML5 video has loaded? I want to draw a CSS styled “loaded” bar that’s width represents this figure. Just like You Tube or any other video player. So just like you tube a video will play even if
CSS2 cursor not displaying “hand”
I’m following the standard of W3C here http://www.w3.org/TR/CSS2/ui.html and here http://www.quirksmode.org/css/cursor.html#note. However, the element isn’t displayed the hand when mouseover. Please help. When viewing with IE9 and mouseover, it doesn’t change the cursor into the “hand”, but it’s just the regular arrow instead. Please advise. Thanks! Answer It should be cursor: pointer; alone because hand is a proprietary value only
How to jump to top of browser page
I’m writing a modal popup and I need the browser to jump to the top of the screen when the open modal button is pressed. Is there a way to scroll the browser to the top using jQuery? Answer You can set the scrollTop, like this: Or if you want a little animation instead of a snap to the top:
How do I hide the address bar on iPhone?
How do I hide the address bar on iPhone? I tried two different methods so far: The scroll down one pixel trick with JavaScript on page load And the following meta tags: Also this: I am completely confused. PS: Oh, I forgot a really important thing: the web page itself does not overflow the browser window. It probably is the
How can we avoid the shake when we hover over an element and set its border?
How can we avoid the shake when we hover over an element and set its border? Here is a sample of the code I wrote: http://jsfiddle.net/s3N2h/ Is there a technique to avoid the shaking? Suppose I hover on File, the borders appears, but that line of text moves a little to the right due to the borders getting rendered. If
HTML input fields does not get focus when clicked
I have a problem and I can’t figure out what exactly is causing this behavior. I cannot access my input fields and textareas on my HTML form. Unfortunately, the JS, HTML and CSS are very large, so I can’t really post it all here. Can anybody tell me what to look for when debugging this strange behavior? UPDATE If I
Append Style to DOM not Replacing Existing
How can I append style element to DOM without eliminating existing style on the item (eg color, text-align, etc)? The event calls the function, but the problem is ‘Style’ gets completely replaced with the single item instead. I have simple code triggered on the event: Answer Which browser are you using? In Chrome, this works for me: When I click
Get CSS path from Dom element
I got this function to get a cssPath : But i got something like this : html > body > div#div-id > div.site > div.clearfix > ul.choices > li But to be totally right, it should look like this :html > body > div#div-id > div.site:nth-child(1) > div.clearfix > ul.choices > li:nth-child(5) Did someone have any idea to implement it
Select Element By CSS style (all with given style)
Is there a way to select all elements that have a given style using JavaScript? Eg, I want all absolutely positioned elements on a page. I would assume it is easier to find elements by style where the style is explicitly declared: the style is non-inherited (such as positioning) the style is not the default (as would be position:static). Am