Get A Point In A Image
May 26, 2006How can I get the position in a image area in where I do clic?
If I have a jpeg image 400x500 and I do clic on 200x100 the script returns height=200
width=100
How can I get the position in a image area in where I do clic?
If I have a jpeg image 400x500 and I do clic on 200x100 the script returns height=200
width=100
I am trying to make one small modification to a website. I just want to make an image that, when clicked, scrolls to a certain point.
This is the javascript that I think controls the scrolling:
var element_y;
var swiffy;
var cur_groupid;
[Code]....
I have done how to find out co ordinate(x and y axis) of a point on an image where a user clicks. But I need the opposite thing now. I need to mark a point on an image when a user gives suitable x axis and y axis co ordinate as input, how can i do this with java script?
View 2 Replies View Relatedhow i can show an image in any point in my page?
View 1 Replies View RelatedI have a client request I need a little advise on with an image slider.Client says;"There will be 4 photos that roll over two times each then stop on the Home Page photo then opens a text box over the left of the image"The part I'm not sure how to do is how to set the slider to stop on the Home Page image after the 4 images go through the animation two times.
View 2 Replies View RelatedI have some moving objects & they are using the top left spot of the object to 'hold' or 'pivot' off. how i make the 'pivot' point in the centre of the image. I think it is somewhere in this section of code:
[Code]...
Is there a method to get the x and the y coordinates where a user click in
the screen?
Can anyone please help/direct me to find/write a simple Javascript function to clean up a decimal point or a coma on a number.
For Example I need
10.000 to become 10000
or
10,000 to become 10000
I just wondered how I can refer to the following two
textboxes in this form:
<FORM action="FormWrite.php" method="post" name="submitForm">
<INPUT NAME="inputValues[etunimi]" SIZE=40>
<INPUT NAME="inputValues[sukunimi]" SIZE=40>
<INPUT TYPE="button" onclick="javacscript:sendForm();"
VALUE="Lähetä">
</FORM>
the reason the [] signs are in the name is to get all the textboxes values
in one variable
when using a php script.
- But how can I refer to it with javascript? For example; I tried
alert(document.submitForm.inputValues[etunimi].value);
I'm using a third-party chat application. They require that form field
names be formatted "SESSIONVAR!FIELDNAME". The bang is creating
headaches when I try to write validation script. How can I handle this
format properly? I'm not sure how to escape the exclamation point
within my code.
<form action="..." method="post">
<input type=image name="Image1"
src="..."/>
</form>
When I click on the image the form submitted to the server. As I can
see post data contains next additional values: Image1.x=121 and
Image1.y=64 These values are coordinates of clicked point relative to
image.
Can I get these values in onclick event handler (within the
beforeSubmit method)?
what's the point of using x.constructor.prototype? (highlighted in red) why not directly use x.prototype. classname to check whether 'classname' property is in this class?
View 14 Replies View RelatedI have a script that inserts a Smiley into a textarea for a forum script I'm working on.It works, except that the insertion will only appear at the end of all the existing text.Is there some way to have the smiley insert at the cursor point?
Code:
function AddText(form, Action){
var AddTxt="";
[code]....
I want to have a world map where you can hover over icons on a few countries and a popup text box will show where that place is.
View 4 Replies View RelatedI'm trying to utilized a more object-oriented approach to managing
window events in javascript. Thus, I am creating a "controller" object
to handle events and interact with the server. However, I apparently
don't fully understand what "this" refers to. In the code below I was
expecting that when the button was clicked (handleDeleteButtonClicked
function) that "this" would be pointing at a ViewController object.
Instead it was the Button (HtmlInputElement).
<html>
<head>
<script>
/* Constructor */
function ViewController() {
this.foo = "bar";
}
/* delete button handler */
ViewController.prototype.handleDeleteButtonClicked = function() {
window.alert("delete clicked, this=" + this + " this.foo= " +
this.foo);
};
/* initializer */
ViewController.prototype.initialize = function() {
document.getElementById("delete-button").onclick =
this.handleDeleteButtonClicked;
};
</script>
</head>
<body onload="javascript:new ViewController().initialize();">
<input id="delete-button" type="button" value="Delete">
</body>
</html>
I am doing a virtual point of sales page. Once the user has paid, he should be readdressed to the original web page. But this doesn't happen. I have realized the payment bank code is window.opener.location='[URL]'. I have copied their code and changed that by window.open ("[URL]") and it perfectly works. I have replicated the situation in these links...
The one that doesn't work [URL]
And the one I have modified and works [URL]
They insist their code is ok. Obviously I cannot modify their code located in their server.
I use the following to round off to two decimal point.It works fine
function roundNumber(rnum, rlength) {
var newnumber = Math.round(rnum*Math.pow(10,rlength))/Math.pow(10,rlength);
return newnumber;
}
[Code]....
how to get two decimal place instead of 1?
I am looking for an autofill script to use with with a point of sale system. We would like to hook a credit card reader to our computers and when we swipe the credit card it will autofill the customers information the fields so it does not have to be done by hand on every sale.
View 3 Replies View RelatedFunction below will output price value in text field based on drop-menu option. It's working but I want it's always show value in 2 decimal point.[code]...
View 3 Replies View RelatedI've created a page with an image of a man where a user is able to click on an area and a div is positioned at that point containing a white circle. This code works in all browsers except IE 6 where it creates a duplicate white circle beneath the one which is placed in the correct location. How to get rid of this second circle? The circle is essentially a div with a background image assigned.
Code:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="ImageClick.aspx.vb" Inherits="ImageClick" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL]">
<html xmlns="[URL]" >
<head runat="server">
<title>Image Click</title>
<script type="text/javascript" language="javascript" src="JQuery.js"></script>
<script language="javascript" type="text/javascript">
window.onload = Init .....
I understand that there is no need to initialize a variable at the point of declaration. OTH, what is the default type of a [declared] variable? For example:
[Code]...
I wrote a regex to edit a decimal number. you're allowed 1,2, or 3
digits before the decimal point, and 0,1,2,or 3digits after the decimal
point. Of course, you can't enter a decimal point without at least a
digit after ("5." is invalid). So here is my regex
pattern=/^d{1,3}(.(?=d))d{0,3}$/
This works fine for every case except an integer. In other words, it
tests false for entering 5, or 567.
I don't see why it tests false for integers. I'm allowing 1-3 digits
before the decimal point, then a decimal point only if the next
character is a digit (the lookahead clause), and then 0-3 digits after
the decimal point.
I've gotten around this problem with other javascript code around
the regex, but I'd just like to know why this "clean" solution doesn't
work.
How can jQuery locate a non-predetermined DOM insertion point? My application relies on custom code to "bootstrap" itself. I'm wondering if similar functionality is available in jQuery?
My app works in the following fashion:
- user places a script tag in their web page.
- my script fires and performs the following routines:
- scriptLocation = whereAmI()? (find scripts in document, length -1)
- insertBefore(DIV, scriptLocation);
- use DIV as canvas, DOM target for all that follows
- install application in DIV
Note that my custom app does not wait for any kind of "ready" state. It has no dependencies on the surrounding document. It fires inline. My impression is that jQuery's approach ("Find something, do something") is incompatible, because it relies on a known DOM insertion point. It would seem straightforward to "query" the DOM, and find an element of known ID. That would conflict with my business constraint; I have no control over the destination page. Are my assumptions about jQuery true? Or is there a way for a jQuery script to wake up, find its location, and the install elements there?
a simple "../" doesn't seem to work :(
let me know if there's any information I can provide.
on my contact page, I have some hidden divs. One is for a google map. This div is only shown when the user has clicked to open the div. As I am working with smarty my template looks like this: <span id="gmap"> literal}
[Code]....
in FCK-Editor I would like to do the following:On one page there should be severalHeaderText under the header, which is hidden, when the text is loaded and slides up and down after click on headerHtml, which is easy to edit with FCK could look like this:
<p><a href=""><span class="click">Header</span></a></p>
<p><span class="text">Text under the header, which is hidden, when the text is loaded.</span></p>
[code]....