dhtml

remove css hover style

跟風遠走 提交于 2019-12-06 19:41:34
问题 I have mark up that toggles the hover css style using this rule. When there's a checkbox inside the panel I want to remove the background image style. Is this possible? I've tried the following although it fails. CSS: .StaffMode .day ul li.standard a:hover table { background:url("test.png"); } JS: $("li.test table li").hover( function () { if($(this).children(':checked')) { alert('need to remove the background image style'); // shows as expected $(this).children('a').removeClass('hover'); //

Check users resolution in css?

瘦欲@ 提交于 2019-12-06 15:53:57
问题 is it possible to behave according to the user's resolution? 回答1: Not with CSS, no. But with JS, sure. if (window.screen.width <= 800 && window.screen.height <= 600) { //do something(); } 回答2: css3 media queries will allow you to apply stylesheets or @media rules according to the size of the client, among other properties. They don't fallback in non comforming browsers, so they are not ripe for general use, but if you are young it may be worth learning how it is done. http://www.w3.org/TR

How to get complete HTML body using browser helper object (BHO) in case of DHTML/AJAX page?

做~自己de王妃 提交于 2019-12-06 15:04:13
问题 I'm writing a BHO that analyze the HTML taken from the 'onDocumentComplete' event of 'DWebBrowserEvents2' . Currently it works fine, unless I have a DHTML/AJAX page, where HTML handle is delivered too soon. For sample, I tried using it on 'http://www.google.com' . From the 'onDocumentComplete' event I can get most of the page but in the topmost link/anchors, the 'href' for maps, videos, orkut etc. is not available (normally it is javascript:void(0) ). Has anyone any ideas how to capture it

div align=center

霸气de小男生 提交于 2019-12-06 12:35:12
How i can do a alignement of table div inside div to align=center <div> <div style="margin:auto; width:100px;">asd</div> </div> ebt div.a{ margin-left:auto margin-right:auto } 来源: https://stackoverflow.com/questions/3202612/div-align-center

insertRow vs. appendChild

只愿长相守 提交于 2019-12-05 23:35:49
问题 Which method is preferred for adding a row to a table? var tr = tbl.insertRow(-1); or var tr = document.createElement('tr'); tbl.appendChild(tr); ? 回答1: insertRow would be the much better. It is supported by grade A browsers and it's less verbose and a cleaner API. 回答2: insertRow might be argued as more reliable since it's DOM[1]. The appendChild method is consistently faster (albeit marginally) across all tested browsers (IE6/7, FF3, Chrome2, Opera9) when operating outside of the DOM, but

Javascript: Have body onload function wait until scripts have completed

纵然是瞬间 提交于 2019-12-05 22:13:50
I have some functions that I am calling and they take some time (milliseconds), but I don't want the page to display until these functions have completed. Right now, I can tell that the page loads and then the scripts eventually complete. Right now, I am calling the functions in the body onload. Also, another issue I may have is that I need to access div elements in the html content, can I do that in my body onload function (getElementById('somDiv')? Here is the workflow. Make a call to getElementById('someDiv') to get an element from the page. Invoke the function someFunc, this function is in

Scrolling a page using location.hash in Safari

安稳与你 提交于 2019-12-05 12:37:14
I have a forum page that displays a tree view of messages below the currently selected message. When you click on a message in the tree the new message body is loaded into a div near the top of the page using AJAX and then the following code is run: window.location.hash = "page_top"; Of course "page_top" is an anchor element near the top of the page, so the newly loaded message body scrolls into view. This works fine on all the browsers, except Safari. On Safari (tested on PC and iPhone) it only works the first time you set location.hash . If you set it again the page does not scroll. The end

cross-window javascript events

為{幸葍}努か 提交于 2019-12-05 07:48:35
I am launching a popup window with window.open(...) and I pass an elementId to the new popup window. Then during startup of the popup window I find the element in the opener window that matches the elementId passed to the popup. Then the popup subscribes to events on that element using jQuery.bind(...). Then from inside the opener window I fire these events using jQuery.trigger(...), I also tried triggerHandlers. The problem is that my popup's eventHandlers never get called. I can subscribe to the events from within inside the opener window no problem. However, when I try from the popup, it

remove css hover style

眉间皱痕 提交于 2019-12-05 01:00:32
I have mark up that toggles the hover css style using this rule. When there's a checkbox inside the panel I want to remove the background image style. Is this possible? I've tried the following although it fails. CSS: .StaffMode .day ul li.standard a:hover table { background:url("test.png"); } JS: $("li.test table li").hover( function () { if($(this).children(':checked')) { alert('need to remove the background image style'); // shows as expected $(this).children('a').removeClass('hover'); // this doesnt work? } } ); What you need to do is put some restriction on your :hover rule, and have your

Check users resolution in css?

纵饮孤独 提交于 2019-12-04 19:27:42
is it possible to behave according to the user's resolution? Not with CSS, no. But with JS, sure. if (window.screen.width <= 800 && window.screen.height <= 600) { //do something(); } css3 media queries will allow you to apply stylesheets or @media rules according to the size of the client, among other properties. They don't fallback in non comforming browsers, so they are not ripe for general use, but if you are young it may be worth learning how it is done. http://www.w3.org/TR/css3-mediaqueries/ To apply a style sheet to a document when displayed on a screen greater than 800 pixels wide: