|
I assume you are after the functionality of tracking the mouse position using those red lines on the top and left of the content area...
You can use the jQuery mouse move event to track the mouse position. You can then position some red colored divs at the x and y coordinates of the mouse.
|
|
|
|
|
No Sir,
I want the Ruler which is On the corner of the Image Layout with margin.
If you can think then I Can.
|
|
|
|
|
Did you bother reading the source code?
|
|
|
|
|
Hello Dear,
I am providing a code you add own event just like the following code commented.
<script type="text/javascript">
var OnMapCreating = function(map) {
var mapParser = Map1.GetMapParser();
mapParser.addControlsInJson = function(controls, onDrawEnd, onEditEnd) {
for (var key in controls) {
if (controls[key]) {
if (key == 'Modify') {
if (onEditEnd) {
controls[key].onModificationEnd = onEditEnd;
}
} else if (key != 'Normal') {
if (onDrawEnd) {
controls[key].featureAdded = onDrawEnd;
//controls[key].featureAdded = function() {
// alert('ok');
//}
}
}
this.map.addControl(controls[key]);
}
}
}
}
script>
|
|
|
|
|
i'm trying to call a web service from java script code stored NOT in Html but in an extenarl file .js. My code is this:
service.useService("http://localhost:10000/WebS_cod_01/WebS_codEurService.asmx?wsdl", "WebS");
Photo = service.WebS.callService("webS_codEurProcessWS" , photoID);
checking with Firebug i find this message:
"service is not defined"
where i'm wrong ?
thanks in advance
|
|
|
|
|
|
i am using console.log() in my code.where the output will be printed.
modified 16-Feb-12 0:42am.
|
|
|
|
|
|
|
Hi,
i like to disable the buttons on check of the checkbox....using Jquery
i have tried in 3 different ways...
1.attr("disabled", true)-- working in IE not in FF
2.attr("disabled", "disabled")- working in IE not in FF
3.attr("diabled") not working in both...
i want to know the property which is supported by all the browsers(like safari, chrome etc..)
thanks in advance
|
|
|
|
|
I suspect the problem is somewhere else. $('#id').attr('disabled',true) is working for me in FireFox, IE, Chrome and Opera. Setting it back to 'false' enables the inputs again.
|
|
|
|
|
I agree with graham
I tested with
below code:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<div>
<input type='checkbox' value='10' id='id'> <label for='id'>Test Checkbox</label>
</div>
<BUTTON onclick='a=!($("#id").attr("disabled")); $("#id").attr("disabled",a)'>
test
</BUTTON>
it work fine
|
|
|
|
|
If I will use <asp:button ...=""> and <asp: checkbox...=""> ....How can I disable checkbox
|
|
|
|
|
The code you are using has always worked for me so not sure what's wrong but as a point, the second one in your list is the correct one. If you are trying to enable the check boxes again you will have to use the removeAttr method as W3 standards say that the mere presence of the disabled attribute means the control is disabled, regardless of value (which some of the major browsers follow).
As for why your check boxes don't disable I can only suggest that IE and FF are handling your HTML differently (check Id's are the same, that you are only trying to set the disabled attribute after full page load (use $(document).ready if you aren't!) etc. etc.)
Hope this helps,
Ed
|
|
|
|
|
How can i use backbone.js.What is the purpose of backbone.js.Post some sample code.Actually i tried on google.I am not getting correct solution.
|
|
|
|
|
DeepthiTanguturi wrote: Actually i tried on google.
And you couldn't find this[^]?
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
|
I've hit a wall trying to use javascript to write a table with some image tags. I'm looping through an array of image names, then setting their src attribute. The function is creating the tags, but all that displays is the 'missing image' thumbnail. The function is fired via a button. Below is my code.
Thanks!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional/EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex">
<title>Testing Javascript</title>
<script type="text/javascript">
function getImages() {
var allImages, vRow, vCell, vText, vImg;
var vCnt, i, j, x, y;
var vTable = document.createElement("TABLE");
var vTBody = document.createElement("TBODY");
vTable.appendChild(vTBody);
var images = new Array();
images[0] = "image1.jpg";
images[1] = "image2.jpg";
images[2] = "image3.jpg";
vCnt = images.length;
for (i=0; i < vCnt; i++)
{
vRow = document.createElement("TR");
vCell = document.createElement("TD");
var image = images[i];
vImg = document.createElement("IMG");
vImg.setAttribute("src", "images/" + image);
vCell.appendChild(vImg);
vRow.appendChild(vCell);
vTBody.appendChild(vRow);
}
var vTableContainer = document.getElementById("vTableContainer");
vTableContainer.appendChild(vTable);
}
</script>
</head>
<body bgcolor = "#FFFFFF">
<h2>Javascript and Images</h2>
<div id="parentDiv">
<p>
Trying to set the image source with js...
</p>
<div id="childDiv">
<form method="GET">
<input type="button" value="DISPLAY IMAGES" onClick="getImages();" />
</form>
</div>
<div id="vTableContainer"></div>
</div>
</body>
</html>
|
|
|
|
|
|
Dean, Thanks for the reply. I've been working with the jquery api just a bit today, and I really like it. Thanks for the reference!
|
|
|
|
|
Please vote if you found my answer useful.
thanks
|
|
|
|
|
I just checked about setAttribute. It seems that only Firefox implemented it properly.
JQuery is a very good choice. for your information you can also use
imgobject.src='my/image/source.jpg'; //it will do fine
|
|
|
|
|
(1) Please don't use names of collections for private vars
so var images = new Array();
better var arArrayOfImagesObjects=new Array();
images is al pre-dfined collection: document.images
see http://msdn.microsoft.com/en-us/library/ms537461.aspx
(2) To set scr:
valueof .src is not same like pure string
preload image
var imgObjekt1=new Image(); // height and width if you want
imgObjekt1.src='whatYouWant.jpg'; // maybe with path
vImg = document.createElement("IMG"); // check pionter !
if(vImg!=null)
{
// append into object (into child of body) // append into collection images automatically
// check pointer of appended object, use e.g. var imgAppendedImgObject
if(imgAppendedImgObject!=null)
{imgAppendedImgObject.src=imgObjekt1.src; // will be (now) rendered in body
// don't use setAttribute("src", "images/" + image);
}
}
(3) FIRST optimize your code during edit and THEN check errors at run time.
to createElement and appendChild
check always pointers != null
if you use a collection like images check too
declare vars inside of function --> local vars
declare vars inside of for{} --> declare 1 time outside of for and use inside
declare constants like "image1.jpg" outside of function --> use global code e.g. at begin of js-file (easy find and edit in js-file).
|
|
|
|
|
Would someone please tell me why this js won't display images in IE 7, but works perfectly in Firefox? I'm using Windows XP, and I've double-checked all my settings in IE 7. Thanks!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Sample</TITLE>
<SCRIPT LANGUAGE="JavaScript">
window.onload = fnWrite;
function fnWrite()
{
// Declare variables
var vTable = document.createElement("TABLE");
var vTBody = document.createElement("TBODY");
var vRow, vCell, vDiv, vImg;
var i;
var images = new Array();
images[0] = "images/treble_f1.JPG";
images[1] = "images/treble_c1.JPG";
images[2] = "images/treble_d1.JPG";
images[3] = "images/treble_e1.JPG";
// Insert vBody into vTable
vTable.appendChild(vTBody);
// Insert a row
vRow = document.createElement("TR");
vTBody.appendChild(vRow);
vCell = document.createElement("TD");
vRow.appendChild(vCell);
// Insert images
for (i=0; i<images.length; i++)
{
vDiv = document.createElement("DIV");
vCell.appendChild(vDiv);
vImg = document.createElement("IMG");
vImg.src = images[i];
vImg.setAttribute("alt", "image");
vCell.appendChild(vImg);
}
// Insert the table
vTableContainer.appendChild(vTable);
}
</SCRIPT>
</HEAD>
<BODY>
<H1>Javascript Won't Work in IE 7</H1>
<div id="vTableContainer"></div>
</BODY>
</HTML>
|
|
|
|
|
Try moving the line
window.onload = fnWrite;
after the fnWrite() function block.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|