JavaScript Development
 
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 DesignJavaScript Development

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 August 10th, 2001, 12:59 PM
G-funk G-funk is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2001
Posts: 3 G-funk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
javascript guru needed

ok, i'm simply making a little slider selector thing, the code is here: URL

anyway, i would like to know if there is a simple way to make it work with the postion being relative instead of absolute. is there some way to get the absolut pixel position of an image dynamically in javascript? i'm kind of new to javascript.

thanks

Reply With Quote
  #2  
Old August 10th, 2001, 01:32 PM
DJdrenaline DJdrenaline is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2001
Location: Toronto, Ontario, Canada
Posts: 631 DJdrenaline User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 19 sec
Reputation Power: 12
Whats the advantage of having it relative? The way it is is fine... change the 'return true' to 'return false' in the mouseMove() function. If it doesnt work, change it back. That should get rid of being able to highlight areas of the document while you're dragging the dropper.

Reply With Quote
  #3  
Old August 12th, 2001, 07:51 PM
G-funk G-funk is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2001
Posts: 3 G-funk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
thanks for the mouse move tip, that woked...

the reason i want the postion to be relative is because i have a page with some graphs that can be different sizes and the position of the slider will not always be the same. if there's no way to do it with the position being relative that's fine but i just want to make sure i can't do it with the slider first.

Reply With Quote
  #4  
Old August 12th, 2001, 10:28 PM
DJdrenaline DJdrenaline is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2001
Location: Toronto, Ontario, Canada
Posts: 631 DJdrenaline User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 19 sec
Reputation Power: 12
Change the position:absolute; property for ALL the divs to position:relative;

Add:
left:#;top#;

That will give you a # of pixels offset to the div's static position.

Reply With Quote
  #5  
Old August 12th, 2001, 10:48 PM
G-funk G-funk is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2001
Posts: 3 G-funk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
thanks for the suggestion but i've already tried that. the problem happens when i do something like this:

domRed.xpos = parseInt(domRed.left);

this then takes the left of red (be it relative or absolute) and assumes it's an absolute position. this is my problem, maybe i just haven't stated my question clearly enough before, for that i am sorry.

i'm just wondering if there is a way in javascript to get the absolute position of an image on a page after i have placed the div as relative...if you can't do that would there be a way to make my slider code respect the relative positions of my divs?

thanks for all your help so far

Last edited by G-funk : August 12th, 2001 at 10:52 PM.

Reply With Quote
  #6  
Old August 13th, 2001, 10:04 AM
DJdrenaline DJdrenaline is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2001
Location: Toronto, Ontario, Canada
Posts: 631 DJdrenaline User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 19 sec
Reputation Power: 12
You could put the image in a layer, and with javascript, use absolute positioning to position the slider.

This is for IE only:
<script language="javascript">
function position() {
document.all["div2"].style.top=document.all["div1"].style.top+document.all["div1"].style.height+50;
}
</script>

That would give you 50px between the image and the slider div.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > javascript guru needed

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