This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

whenever i click on image

 
sudharani Savadi
Ranch Hand
Posts: 30
Eclipse IDE Spring Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Pie
Posts: 2496
10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does this have to do with security (which this forum is all about) ?
 
sudharani Savadi
Ranch Hand
Posts: 30
Eclipse IDE Spring Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic