File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Security and the fly likes whenever i click on image Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Security
Bookmark "whenever i click on image" Watch "whenever i click on image" New topic
Author

whenever i click on image

sudharani Savadi
Ranch Hand

Joined: Feb 23, 2011
Posts: 30

hi experts !


whenever i click on image it should be toggled to another image and also returns the x and y co-ordination values. simultaneously it should retrieve x,y pixel values and has to display the next image. I want to apply the same procedure for five images in a single JSP page. I tried with the below code i got only x and y values but image is not toggling.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<script type="text/javascript">

var obj;

function point_it(event){

pos_x = event.offsetX?(event.offsetX):event.pageX-document.getElementById("pointer_div").offsetLeft;
pos_y = event.offsetY?(event.offsetY):event.pageY-document.getElementById("pointer_div").offsetTop;
document.pointform.form_x.value = pos_x;
document.pointform.form_y.value = pos_y;


obj=document.getElementById("pointer_div")
obj.style="background-image:url('/pic03.jpg');width:500px;height:333px;"

}

</script>

</head>
<body>

<form name="pointform" method="post">

<div id="pointer_div" onclick="point_it(event)" style = "background-image:url('pic01.jpg');width:500px;height:333px;"></div>


You pointed on x = <input type="text" name="form_x" size="4" /> - y = <input type="text" name="form_y" size="4" /></div>


</body>
</html>


help me out.


I appreciate your help.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
What does this have to do with security (which this forum is all about) ?
sudharani Savadi
Ranch Hand

Joined: Feb 23, 2011
Posts: 30

I have not asked about the security. I am providing password authentication by using images, I mean to say instead of giving text I can use images to authenticate a user. I know its not possible with JSP that's why i want use JavaScript but I am not getting the correct output.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: whenever i click on image
 
Similar Threads
Social media integration
resultset is not working properly
IE shows a horrifying gap!
Problem hiding div within div
cursor position in iframe