smazharzaidi Posted May 10, 2011 Share Posted May 10, 2011 hi friends im new in this forum . i have a question my question is that in gogole map api we can click on a map and place a marker on that postion . how can i do that in a simple image when i was click on image and place marker on that postion ??? is that possible in javascript ?? Quote Link to comment https://forums.phpfreaks.com/topic/236047-javascript-image/ Share on other sites More sharing options...
requinix Posted May 10, 2011 Share Posted May 10, 2011 Sure. Stick an onclick on the image, grab the mouse coordinates when that fires, and place the new image accordingly. Quote Link to comment https://forums.phpfreaks.com/topic/236047-javascript-image/#findComment-1213485 Share on other sites More sharing options...
JasonLewis Posted May 12, 2011 Share Posted May 12, 2011 Just to provide a few useful links using the jQuery library in paticular.  http://docs.jquery.com/Tutorials:Mouse_Position http://jquery-howto.blogspot.com/2009/07/identifying-locating-mouse-position-in.html  Then of course, assuming you wrap the image in a div, just simple append the new image using .append() on the containing div. Ensure your containing div has a set position of relative, then set the position of the new image to absolute and position it according to the coords you received from the above techniques. You may also need to adjust the z-index of the new image.  Remember, Google is your friend.  Good luck. Quote Link to comment https://forums.phpfreaks.com/topic/236047-javascript-image/#findComment-1214360 Share on other sites More sharing options...
smazharzaidi Posted May 23, 2011 Author Share Posted May 23, 2011 thanks to all. friends . but i done before yur replys . anyways thanks both of u . if im in another issue i remember u ............ Quote Link to comment https://forums.phpfreaks.com/topic/236047-javascript-image/#findComment-1218942 Share on other sites More sharing options...
requinix Posted May 23, 2011 Share Posted May 23, 2011 So... you figured it out in the 24 minutes between your post and mine, and now two weeks later you're letting us know that? :-\ Quote Link to comment https://forums.phpfreaks.com/topic/236047-javascript-image/#findComment-1219070 Share on other sites More sharing options...
smazharzaidi Posted May 24, 2011 Author Share Posted May 24, 2011 i m late to tell of u ...............but yur idea help me in next issues Quote Link to comment https://forums.phpfreaks.com/topic/236047-javascript-image/#findComment-1219480 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.