Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Sponsored Reviews   Improve your ranking, submit to directories   V7N Directory

Reply
 
LinkBack Thread Tools Display Modes
Old 09-07-2005, 08:07 AM   #1 (permalink)
Contributing Member
 
Join Date: 07-30-05
Posts: 282
iTrader: 0 / 0%
Latest Blog:
None

Radnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really nice
Need position (Y) of an image on screen

Hello all!

I have a page where I read in content from a TEXT file and insert it on the page via a PHP script. This works great!!!! Then I have a graphic that follows. I need to know where on the screen this graphic is... (Y pos)

I post the graphic with a <span id="abc">img.... </span>

I've tried:
d=document.getElementById("abc");
alert (d.top); <---- undefined since I did not give it a value

I've tried:
alert (d.offsetParent);
alert (d.offsetTop);

my url looks like: www.abc.com/test.php?info="file"
I can change "file" to "file1" and show different content (works GREAT!!!)

Now the reason I need the Y pos of the graphic.... If file1 is short, I want to move the graphic to the botom of the screen and fill the body with bgcolor (white). If file1 is long, great... it writes on a white bg and goes on... looks good too.

Now.... I DO NOT want to use tables. I and a firm believer on keeping content separate from formatting (CSS!!!).

Thank you!!!
Radnor
Radnor is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 09-07-2005, 09:47 PM   #2 (permalink)
v7n Mentor
 
noob_0001's Avatar
 
Join Date: 02-17-05
Posts: 904
iTrader: 0 / 0%
Latest Blog:
None

noob_0001 is a splendid one to beholdnoob_0001 is a splendid one to beholdnoob_0001 is a splendid one to beholdnoob_0001 is a splendid one to beholdnoob_0001 is a splendid one to beholdnoob_0001 is a splendid one to beholdnoob_0001 is a splendid one to beholdnoob_0001 is a splendid one to beholdnoob_0001 is a splendid one to beholdnoob_0001 is a splendid one to beholdnoob_0001 is a splendid one to behold
Why don't you let the string lengh of the content determine it for you. Longer than X fine if not then move image.
noob_0001 is offline  
Add Post to del.icio.us
Reply With Quote
Old 09-08-2005, 01:01 AM   #3 (permalink)
Contributing Member
 
DragonEye's Avatar
 
Join Date: 10-13-03
Location: Belgium
Posts: 322
iTrader: 0 / 0%
Latest Blog:
None

DragonEye is liked by somebodyDragonEye is liked by somebodyDragonEye is liked by somebodyDragonEye is liked by somebodyDragonEye is liked by somebody
Send a message via MSN to DragonEye
Quote:
Originally Posted by Radnor
Hello all!

I have a page where I read in content from a TEXT file and insert it on the page via a PHP script. This works great!!!! Then I have a graphic that follows. I need to know where on the screen this graphic is... (Y pos)

I post the graphic with a <span id="abc">img.... </span>

I've tried:
d=document.getElementById("abc");
alert (d.top); <---- undefined since I did not give it a value

I've tried:
alert (d.offsetParent);
alert (d.offsetTop);

my url looks like: www.abc.com/test.php?info="file"
I can change "file" to "file1" and show different content (works GREAT!!!)

Now the reason I need the Y pos of the graphic.... If file1 is short, I want to move the graphic to the botom of the screen and fill the body with bgcolor (white). If file1 is long, great... it writes on a white bg and goes on... looks good too.

Now.... I DO NOT want to use tables. I and a firm believer on keeping content separate from formatting (CSS!!!).

Thank you!!!
Radnor

I believe in that too, but I have noticed that most of the time you can save yourself a lot of trouble by putting it into tables. The tools that we currently have to format aren't sufficient I think

Matt.
DragonEye is offline  
Add Post to del.icio.us
Reply With Quote
Old 09-08-2005, 06:12 AM   #4 (permalink)
Contributing Member
 
Join Date: 07-30-05
Posts: 282
iTrader: 0 / 0%
Latest Blog:
None

Radnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really nice
Quote:
Originally Posted by noob_0001
Why don't you let the string lengh of the content determine it for you. Longer than X fine if not then move image.
That's exactly what I need to do. The problem I have is if the file is too short, there is an impact on the way the site looks. Plus, I'd like to keep the page(s) as close to a uniform length as I can.

I may just make it a fixed length. If the file is too long just auto:scroll. I really did not want the scroll bar. But if it is my only solution....

Thanks for the help. Will keep lookin for now.

What I may do now... see if I can determine the length of the info added. We'll see....
Radnor is offline  
Add Post to del.icio.us
Reply With Quote
Old 11-27-2005, 03:38 AM   #5 (permalink)
Moderator
 
LazyJim's Avatar
 
Join Date: 10-13-03
Location: UK
Posts: 2,819
iTrader: 0 / 0%
Latest Blog:
None

LazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to all
Send a message via MSN to LazyJim
Useful info and code on PPK's Quirksmode web site; http://www.quirksmode.org/js/findpos.html
__________________

-LJ-

My advice is to look at each case individually, with an informed mind and an appropriately balanced and objective viewpoint.

Web Design and Development, Ipswich, UK.
My deviantArt
LazyJim is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
'Unable to save image' error for sig image danparks V7N Forum Support 20 02-22-2008 04:13 PM
How do I make an image size relative to screen resolution? CountryNaturals Coding Forum 10 10-22-2007 07:13 AM
Position image inside a CSS box? jolene Coding Forum 1 07-01-2004 10:22 AM
Can a 'swap image' graphic contain image mapping? lizbeth Coding Forum 2 04-22-2004 02:32 AM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 10:30 AM.
© Copyright 2008 V7 Inc