CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 4th, 2001, 09:15 AM
muffy muffy is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Location: UK
Posts: 6 muffy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
In essence I'm trying the grab the pixel coordinates from an onClick event (over a predefined image), and use these coordinates to place a small graphic.

The main problem is dynamically generating the DIV tags to insert an extra graphic along with the appropriate LEFT and TOP styles - LEFT and top being the pixel coords grabbed from clicking the 'main' image.

phew!

Can anyone please help.

Cheers

Reply With Quote
  #2  
Old April 4th, 2001, 12:34 PM
pieux pieux is offline
Seņor Member
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Aug 2000
Posts: 1,157 pieux User rank is Sergeant Major (2000 - 5000 Reputation Level)pieux User rank is Sergeant Major (2000 - 5000 Reputation Level)pieux User rank is Sergeant Major (2000 - 5000 Reputation Level)pieux User rank is Sergeant Major (2000 - 5000 Reputation Level)pieux User rank is Sergeant Major (2000 - 5000 Reputation Level)pieux User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 h 23 m 35 sec
Reputation Power: 36
Do you need to dynamically create a DIV or can you already have the DIV, but have it's visibility property be 'hidden', then when you want it displayed, move it's position dynamically and change the its visibility state dynamically?
__________________
Michael

Reply With Quote
  #3  
Old April 4th, 2001, 12:39 PM
muffy muffy is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Location: UK
Posts: 6 muffy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks for you reply Pieux!

Dynamically creating the DIV would be ideal as the number of 'clicks' to the image will not be know. By doing this we can then display this small graphic on top at each click without being restricted to a finite number.

Any suggestions?

Reply With Quote
  #4  
Old April 4th, 2001, 12:43 PM
pieux pieux is offline
Seņor Member
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Aug 2000
Posts: 1,157 pieux User rank is Sergeant Major (2000 - 5000 Reputation Level)pieux User rank is Sergeant Major (2000 - 5000 Reputation Level)pieux User rank is Sergeant Major (2000 - 5000 Reputation Level)pieux User rank is Sergeant Major (2000 - 5000 Reputation Level)pieux User rank is Sergeant Major (2000 - 5000 Reputation Level)pieux User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 h 23 m 35 sec
Reputation Power: 36
Wow, that was quick!

I think I understand what you are trying to do, but I fail to see where you get an advantage in dynamically creating the DIV as opposed to already having it there. Do you want to have one image for each individual click? Could you provide a specific example? There might be a different (possibly better) way of accomplishing your ultimate goal.

Reply With Quote
  #5  
Old April 4th, 2001, 12:54 PM
muffy muffy is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Location: UK
Posts: 6 muffy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Yeh, the idea is a user will click an image, and based on that click a small image of a cross will be placed on top.
Current working is that a string of pixel coordinates are collected anyway, which I thought could be used to populate the LEFT and TOP values the style...or something of that effect.

This is quite new to me, so I could well be looking at a very difficult methodology.

p.s. the image used is the same for each point

Reply With Quote
  #6  
Old April 4th, 2001, 01:04 PM
pieux pieux is offline
Seņor Member
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Aug 2000
Posts: 1,157 pieux User rank is Sergeant Major (2000 - 5000 Reputation Level)pieux User rank is Sergeant Major (2000 - 5000 Reputation Level)pieux User rank is Sergeant Major (2000 - 5000 Reputation Level)pieux User rank is Sergeant Major (2000 - 5000 Reputation Level)pieux User rank is Sergeant Major (2000 - 5000 Reputation Level)pieux User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 h 23 m 35 sec
Reputation Power: 36
Lightbulb Here's a thought

How about if you create, say, 200 <div>s, each with incremental names. Then, as the user clicks, you change the position of a different <div> (incrementing through your list up to 200). Once you reach the 200th <div>, you start at number 1 again. This is a technique used by people that develop first-person shooter type games in order to put a cap on how much memory is consumed with things like bullet holes. If you don't do this, you will probably risk running out of memory and not having any way of freeing it up, short of leaving that page or closing the browser (which will in effect be leaving the page).

Reply With Quote
  #7  
Old April 6th, 2001, 04:03 PM
darwin48 darwin48 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Location: san francisco
Posts: 30 darwin48 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 13
2cents

it isn't super clear to me: do you need multiple crosses on the screen, or do you want the same one to appear each time?

if only one, you could set a timer on it, so it hides itself again after 3 seconds, and then on the next click, either shows itself again, or if it hasn't yet vanished, it could just reset the timer.

just a thought. i'm a big fan of timers in general.

pieux is right tho, i think: don't bother dynamically writing out the divs, just more and show them as you need them. should save you a little headache.

rgds,
darwin

Reply With Quote
  #8  
Old April 8th, 2001, 02:22 PM
muffy muffy is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Location: UK
Posts: 6 muffy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
thank you

Thanks for your help guys, I have taken the approach suggested by Pieux of incrementally naming several hidden DIVs, and moving them based on a users' onClick event. Works very well.

Thanks again

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > get coordinates and place gfx (CSS)

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap