dhtml

div align=center

℡╲_俬逩灬. 提交于 2019-12-10 10:35:39
问题 How i can do a alignement of table div inside div to align=center 回答1: <div> <div style="margin:auto; width:100px;">asd</div> </div> 回答2: div.a{ margin-left:auto margin-right:auto } 来源: https://stackoverflow.com/questions/3202612/div-align-center

Scrolling a page using location.hash in Safari

白昼怎懂夜的黑 提交于 2019-12-10 06:13:27
问题 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

Applying DIV/Span tag to a word by specific co-ordinates

落花浮王杯 提交于 2019-12-09 23:35:58
问题 Sample HTML Data <body style="width:300px;"> <h3>Long-Text</h3> A simple tool to store and display texts longer than a few lines. The search button will highlight all the words matching the name of objects that are members of the classes listed in searchedClasses, itself a member of the KeySet class. The highlighted words are hypertext. Edit invokes wscripts/acedb.editor, which by default launches emacs. Edit that file to start another editor in its place. Save will recover from the emacs but

Take Postcode to New Field in New Window

安稳与你 提交于 2019-12-08 14:21:53
问题 I have a read only field on a html field which has a name of _Dataaddr_postcode I now need to capture this data and pass it into a new window which loads another file (proxcomp.asp) and use the data in a field on this page the field has an ID of inpAddr. I have this code so far <script type="text/javascript"> var pcodeStart = document.getElementbyId("_Dataaddr_postcode"); var newWindow; function makeNewWindow( ) { if (!newWindow || newWindow.closed) { newWindow = window.open("../hpwprox

Uncaught TypeError - Unexpected behaviour

徘徊边缘 提交于 2019-12-08 12:22:03
问题 var chanceOfLiveCells = 0.5; var gridDomReference = null; var gridDimension = 15; var timer = null; function init() { gridDomReference = document.getElementById('grid'); idleCells = new Array(); liveCells = new Array(); deadCells = new Array(); drawGrid(); createRandomLiveCells(); } function drawGrid() { var counter = 0; var nodes = new Array(); for(var x = 0; x <= gridDimension - 1; x = x + 1) { nodes.push('<tr>'); for(var y = 0; y <= gridDimension - 1; y = y + 1) { nodes.push('<td id="' +

Using a TreeWalker to retrieve non-Javascript text nodes

无人久伴 提交于 2019-12-08 06:35:59
问题 This question teaches how to get all TextNodes inside the document, and this is getting me the Javascript texts as well. What is the best way to filter out all the Nodes that are Javascript code? 回答1: Text inside <script> tags has only one thing in common: their parent is a <script> element. if (node.parentNode.nodeName !== 'SCRIPT') Another approach is to use the filter: var rejectScriptTextFilter = { acceptNode: function(node) { if (node.parentNode.nodeName !== 'SCRIPT') { return NodeFilter

Limit displayed length of string on web page

淺唱寂寞╮ 提交于 2019-12-07 23:18:49
问题 I'm looking for a technique (javascript, CSS, whatever ???) that will let me control the amount of a string that is displayed. The string is the result of a search (and therefore not initially known). A simple Character count approach is trivial, but not acceptable, as it needs to handle proportional fonts. In otherwords if I want to limit to say 70 pixels then the examples below show different character counts (9 and 15) both measuring the same:- Welcome M... Hi Iain if I've ... If you look

Country/State Dynamic Drop Down List

心已入冬 提交于 2019-12-07 08:35:50
问题 If you go to http://profile.microsoft.com and edit your personal information, you will select your country. When a country is selected the city and/or state information changes based on what is expected for that country. Does anyone have any examples on how to accomplish this? Is there any service (free service) that provides this information? 回答1: Regarding the data: Country, State, Province WebService? 回答2: Because you tagged your question with "jquery", here is an example of a "Depending /

cross-window javascript events

房东的猫 提交于 2019-12-07 02:42:41
问题 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

jQuery UI performance issues with a table in IE

左心房为你撑大大i 提交于 2019-12-07 01:54:10
问题 I'm having problems getting UI code to perform at all well in IE. I have a table - a matrix of values. Each cell can be empty or hold a list of items. I want users to be able to drag items between cells. So my HTML looks something like this: <table> <tr><td></td><th scope="col">col 1</th><th scope="col">col 2</th></tr> <tr><th scope="row">row 1</th> <td class="droppable-cell"> <div class="draggable-item">item A</div> <div class="draggable-item">item B</div> </td> <td class="droppable-cell"><