I was trying to implement an image panner I found here
Chrome renders the same document differently depending on the extension of the file requested. I have created a test case, where it works when the file it's not named as test.xhtml
You can download the test case from here
Does anybody know why or how to solve it? I want my files to be .xhtml
In IE and FF it works fine.
Code:
test.html / test.xhtml (change the name to see that works with one but not with the other).
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<style type="text/css">
/*Default CSS for pan containers*/
.pancontainer {
position: relative; /*keep this intact*/
overflow: hidden; /*keep this intact*/
width: 300px;
height: 300px;
border: 1px solid black;
}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="http://www.dynamicdrive.com/dynamicindex4/imagepanner.js"></script>
</head>
<body>
<div class="pancontainer" data-orient="center" data-canzoom="yes" style="width: 350px; height: 200px; float: left; position: relative; overflow-x: hidden; overflow-y: hidden; cursor: move; "><img src="./test_files/image.jpg" style="position: absolute; width: 700px; height: 525px; left: -175px; top: -163px; display: block;" />
</div>
</body>
</html>
Are there any free audio players that I can use in my website? Are they customizable?
I've heard of Soundmanager 2. It's a flash based player with a javascript front-end.
Are there any other free players like that?
Hi,
I am using a forever frame (COMET streaming technique) and in IE6 whenever a user clicks on a link (to even just basic JavaScript method) the connection is immediately dropped and has to be manually refreshed.
Has anyone come across a similar issue and / or know how to address it?
Apart from the legal issues..
I'd like to create a website that is the exact copy of another website (I do not own but I know will let me do this) where I change a few things, mainly swap images and hide some divs..
So my "website".. how should I build it? I thought something like an Iframe and javascript but I have no idea if this makes sense.. any idea?
Anyone have experience with game development using javascript and the html5 canvas element?
So far I have found two libraries, are either of these worth using?
http://tommysmind.com/ (XNA Port)
http://gamequery.onaluf.org/ (jquery plugin)
Does anyone have any other resources?
i am tracking the mouse movements of a user using javascript and storing it along with the browser resolution.
Then i can check the user mouse movement in my browser which is 1024 x 768 resolution.
But if the user is using a browser in 800 x 600 then the mouse movements are recorded wrt 800 x 600. And when i see the mouse movements in 1024 x 768 the mouse movements are wrong.
So how can i scale from 800 x 600 to 1024x 768?
Based on http://mark.mymonster.nl/2009/02/28/integration-of-browsers-unloading-with-silverlight/ I know when the user closes a browser window containing Silverlight, by use of javascript. This basically creates a popup window, where the user can stay on the page(by clicking CANCEL), or exit the page (by clicking OK).
I am interested in how I can determine if the user wants to exit the page, or continue to stay on the page.
Hi all.
Is it possible to delete some images from the browser (firefox2) memory using javascript? By doing this, I want to save some precious browser memory and let my web app to work better.
I guess that if possible, it will be something like this:
delete (document.images[7]);
document.images[7].src = null;
document.images[7] = null;
Thanks guys!
Here is an interesting use of JavaScript: reordering items with drag and drop. The implementation itself in my page works fine, but is there a way to determine in which order the user put the items?
I am calling window.location.href = "some url";
I want to check whether that url is opening or not. Means if the url is wrong how do check it in javascript so that I can redirect it to another url.
Thanks.
I have a nascent bridge scoring app that is meant to be stored locally on an iPod touch/iPhone (iPad? Would probably be fugly...)
So far so good, got a custom icon rolling and basic JS navigation laid out, but my problem is that it retains its state when I quit the app. Is there a simple magic Apple meta tag for this? Or is it achieved with javascript?
Thanks for any insight.
jQuery is undoubtedly the best javascript framework available and its plugin base is also pretty awesome. I wanted to know which one is the best framework in terms of
Use Of Plugin
API Design
Ease Of Use
Documentation
Support and Bug fixes
etc...
In my view the best plugins I used so far are
Form plugin
Validation
Nyromodal
jQuery drag&drop, Sortable
EDIT: Made it a community wiki
We have an rich client application running with dojo 1.2.x.
Sometimes users are pasting comments from their word 2007 into an textfield.This is an repeating source for errors with displaying this comments inside an an dojox.grid.
Is there any "javascript" way to stop users pasting from word?
var phoneBookTableValue = [];
phoneBookTableValue.push({ "key":"1", "value":["3396,Accounting ,CCH,,,,","1"]});
phoneBookTableValue.push({ "key":"2", "value":["3284,Acute Care ,CCH,,,,","2"]});
phoneBookTableValue.push({ "key":"3", "value":["3265,Acute'Care East ,CCH,,,,","3"]});
When running the javascript file I get the error "missing ] after element list. Can U help me? PLZ!
I have multiple textboxes with set character limits that together make up a code. There is value in the boxes being separated for a variety of reasons. I want to be able to paste a complete code in the first textbox and have it automatically populate all the textboxes. Is there a way to do this in javascript or a jquery library for this case?
Currently I'm using jQuery autotab on each textbox and I'd prefer to keep that functionality.
I want to set label's value from popup.But label is in frame and I dont know how to achieve it from popup. From parent page,i get this label by following javascript function.
But when I use this function in popup page, I cant find topframe.Do u have any solution about how to success it?
if (window.parent.document.getElementById('lbl'))
{
window.parent.document.getElementById('lbl').innerText = sender.getSelectedItem().get_text();
}
else
{
window.parent.frames['topFrame'].document.getElementById('lbl').innerText = sender.getSelectedItem().get_text();
}
Following is the code which will clone a set of div with their events(onclick) which is working fine for FF but in case of IE it is not firing events associated with each div.
<html>
<head>
<style type='text/css'>
.firstdiv{
border:1px solid red;
}
</style>
<script language="JavaScript">
function show_tooltip(idx,condition,ev) {
alert(idx +"=="+condition+"=="+ev);
}
function createCloneNode () {
var cloneObj = document.getElementById("firstdiv").cloneNode(true);
document.getElementById("maindiv").appendChild(cloneObj);
}
function init(){
var mainDiv = document.createElement("div");
mainDiv.id = 'maindiv';
var firstDiv = document.createElement("div");
firstDiv.id ='firstdiv';
firstDiv.className ='firstdiv';
for(var j=0;j<4;j++) {
var summaryDiv = document.createElement("div");
summaryDiv.id = "sDiv"+j
summaryDiv.className ='summaryDiv';
summaryDiv.onmouseover = function() {this.setAttribute("style","text-decoration:underline;cursor:pointer;");}
summaryDiv.onmouseout = function() {this.setAttribute("style","text-decoration:none;");}
summaryDiv.setAttribute("onclick", "show_tooltip("+j+",'view_month',event)");
summaryDiv.innerHTML = 'Div'+j;
firstDiv.appendChild(summaryDiv);
}
mainDiv.appendChild(firstDiv);
var secondDiv = document.createElement("div");
var linkDiv = document.createElement("div");
linkDiv.innerHTML ='create clone of above element';
linkDiv.onclick = function() {
createCloneNode();
}
secondDiv.appendChild(linkDiv);
mainDiv.appendChild(secondDiv);
document.body.appendChild(mainDiv);
}
</script>
</head>
<body>
<script language="JavaScript">
init()
</script>
</body>
</html>
can anybody tell me whats the problem in above code please correct me..
Hi everyone, I get a script from a website to put it into my website, but the font color is not what I want.
the script is:
< script language="javascript" src="http://www.parstools.net/calendar/?type=2"< /script
and now I want to change the font color of it, what should I do?
I would really appreciate your help, thanks.
This seems like a pretty natural use case to me, though I haven't been able to find anything on it:
Say I have a fixed-width div that is dynamically populated with some number. What's the best way to ensure that numbers with more digits take smaller font sizes such that they fit nicely into that fixed width? Is there some CSS property for this, or do I have to resort to Javascript hackage?
Facebook has a "Dom Placeholder" on their Password field when logging on. When I click on the input for the password, the placeholder disappears and allows me to type my password "masked".
Is this Javascript related and how would I go on replicating this script?
I want to have a text field where people can type in a value. Then I want to have a href open a url with the text field appended to the end.
So if the text field says "elephant" then when they click the link, a page will open with at example.com/elephant.
I think javascript would be the easiest way to accomplish this but I just don't know how.