I'm trying to find an efficient algorithm for dynamically loading background-images for a bunch of <li>'s, and are having some efficiency problems. My current code looks like this:
function elementInView($elem, vps, vpe) {
var elempos = $elem.position();
var pagestart = elempos.top + vps;
var pageend = elempos.top + vps + $...
I hate IE6, in fact I wish microsoft would force out a patch that killed the damn thing stone dead. The following script works fine in IE > 6 & FF,WebKit(chrome etal) without issue; any ideas?
(function getElementsByClass(searchClass) {
node = document;
tag = '*';
var els = node.getElementsByTagName(tag);
...
<tag>
Алекс М
</tag>
When I try to get the content of the following code using DOMDocument functions, it returns something like:
ÐÐ»ÐµÐºÑ Ðœ
I've tried setting DOMDocument encoding to different values (UTF-8, ISO-8859-1), using mb_convert_encoding, iconv and utf8_encode but without success.
How can I get "Алекс М" instead of "ÐлÐ...
Other than using a timer to count the number of elements over time and looking for changes, I can't think of a better way to simulate this event.
Is there some sort of proprietary IE version of DOMNodeInserted? Thanks.
...
This is the code I wrote up to display a Mancala board but it won't display the leading space for some reason. Does anyone know why this is happening? Any help is greatly appreciated.
function display(board)
{
var space = " ";
document.write(space);
for (var i=0;i<board.length/2;i=i+1)
...
I'm trying to select the inner value of the first sibling - using jQuery - in an environment where I cannot alter the html markup.
I have the following:
<tr>
<td>3</td>
<td>bob</td>
<td>smith</td>
<td>[email protected]</td>
<td>
<img src="bobsmith.png" onclick="doSomething()" />
</td>
</tr>
I'm trying to...
How can I iterate through all forms in a document using javascript?
...
I have a document with one CSS linked in. How can I replace the current CSS with one coming from a document that I just fetched with AJAX request using jQuery?
Here's the code I am trying right now, but with no success so far:
$(function() {
$.get('next_page.html', function(data, textStatus) {
$('link[rel=stylesheet]:first'...
Hi,
I am writing a browser plugin with Qt. Im currently facing a problem of getting the dom object of the current page of the browser from my plugin. Any info/help on how to do this would be extremely appreciated.
version: 4.6
browser: firefox/opera
If it isnt possible to get it directly via Qt, how do i convert the NPObject that i get ...
It is possible to access HTML DOM from an applet using netscape.javascript JSObject API.
However, if I query a value of a input type="file", on some browsers (Opera) I get a full path to a selected file, but on other browsers (Firefox, Chrome) just a file name without path.
Is it possible, having an HTML input type="file", to figure out...
I have a gridview in its 3rd cell, there is textbox control, I am calling javascript function on onchange.
Can some body tell me why this is not working in Firefox and Chrome but working in IE
grd.rows[rowindex].cells[3].childNodes[0].value
It return correct value in IE but not in Chrome and firefox (In FF and Chrome it return undefi...
What I have:
A swf exports a function via ExternalInterface
Javascript creates new embed object and adds it to the document
Calling flash functions works fine in other browsers
Calling flash functions will fail in IE 8
Example of exporting functions in swf:
flash.external.ExternalInterface.addCallback("isActive", ...
Example of c...
I have a large javascript string.
var s = '...............'; // this is about 32000 characters long.
if you wonder: that bit of javascript is autogenerated.
Does anybody know if it is better to store it outside of the javascript
For instance in a dom object in the html page and then retrieve it
(e.g. var s = document.getElementById(...
Here is the code I am using to create and add content to a new window via JavaScript:
var newWindow = window.open();
newWindow.document.title = "This is my new window";
newWindow.document.body.innerHTML = "<center>This is content added from the parent window</center>";
This works in every browser I have tested except ...
I'm trying to fire a function on the mouseout of a div. However when you mousover an element in the div it fires the mouseout.
<div id="my_div">
<div class="another_div">X</div>
</div>
<script>
$("#my_div").mouseout(function () {
alert('weeeee, I am out!');
}
</script>
This makes sense but how can I test for the mouseout eve...
I have dropdownlist box and two radiobuttons
If i check first radiobutton, 1,2,3 vil be added to dropdownlistbox.
If i select second radiobutton, 4, 5,6 will be added t dropdownlistbox.
All these are created using java script.Here my problem is, Ididt select the drpdownlist values when i select any radiobutton
Please help me
...
Take a look at the snippet below. Does it create a text node for the string "test" in the DOM? Can I select that node with jQuery for MooTools?
<div id="foobar">
test <img />
</div>
...
For some reason ss.transition() does not affect the appropriate DOM elements after ss.goTo() is triggered by an onclick. The ss.transition() call under //Init does work as expected. I assume this is a scope problem. Little help?
var ss = {};
ss.goTo = function(i) {
ss.old = ss.current;
ss.current = ss.slides[i];
ss.transiti...
I'm pulling in a google news feed, then trying to take out some mal-formatting by accessing the newly-created DOM elements.
var aryClassElements = document.getElementById('google-news').getElementsByTagName('div');
alert("Found "+aryClassElements.length+" divs in Google News");
But this alert shows 0. It hasn't found the newly-create...
Hi folks,
I have a fairly long page (http://tiny.cc/JrSYr) with sections such as google maps, image slider, google ads, brightcove video (optional) and images. Loads nice and quick without JS and a little slower with JS.
I've seen http://www.appelsiini.net/projects/lazyload and was wondering if anyone has used a similar approach or an...