...

View Full Version : Is the only way to achieve screen size based positioning...



kin
07-30-2012, 05:05 AM
Is to use javascript in relations with CSS? If this is not the case then can someone point me in the right direction?

VIPStephan
07-30-2012, 09:46 AM
It depends on what you’re up to.

vikram1vicky
07-30-2012, 09:59 AM
This thread may help you...

http://www.codingforums.com/showthread.php?t=266828

:)

kin
07-31-2012, 03:48 AM
It depends on what you’re up to.

Whatcha mean?





This thread may help you...

http://www.codingforums.com/showthread.php?t=266828

:)


There's that thread of mine I was looking for haha. I knew I posted it a while back but could not find it. I am a newb with vbulletin forums.

tempz
07-31-2012, 03:51 AM
Whatcha mean?

He means, what are you going to use it for?


Resize your website on the resolution the user has;
Display there screen size and ask them to change it.
Change elements/div in your website on a curtain resolution.


:P

kin
07-31-2012, 04:13 AM
It depends on what you’re up to.


He means, what are you going to use it for?


Resize your website on the resolution the user has;
Display there screen size and ask them to change it.
Change elements/div in your website on a curtain resolution.


:P

Ah sorry, well I am trying to position a post entry button so that it's slighly offset from the main news location. No matter what I have tried, relative positioning, margins, and even a new div just for that button seem not to work correctly on different screen resolutions. I also want to know just how to position something so that it stays in that position just to use it for future reference.



Also, what's better to size a div, percentages or pixels, why?

tempz
07-31-2012, 04:19 AM
Ah sorry, well I am trying to position a post entry button so that it's slighly offset from the main news location. No matter what I have tried, relative positioning, margins, and even a new div just for that button seem not to work correctly on different screen resolutions. I also want to know just how to position something so that it stays in that position just to use it for future reference.

You want to position a button but able to move it freely? Do you want to be a fixed position that when the user scrolls it follows him? Or when the user scrolls it doesn't move.

None moving, when user is scrolling.
CSS


.mydiv {

position:relative;
top:0; /* You would use these to move the button using em, pt, % or px. */
left:0;
right:0;
bottom:0;
}


Moving following the user
CSS


.mydiv {

position:fixed;
top:0; /* You would use these to move the button using em, pt, % or px. */
left:0;
right:0;
bottom:0;
}


I'm not sure if this is what you mean, but the way you described it is what I did above.

kin
07-31-2012, 05:00 AM
You want to position a button but able to move it freely? Do you want to be a fixed position that when the user scrolls it follows him? Or when the user scrolls it doesn't move.

None moving, when user is scrolling.
CSS


.mydiv {

position:relative;
top:0; /* You would use these to move the button using em, pt, % or px. */
left:0;
right:0;
bottom:0;
}


Moving following the user
CSS


.mydiv {

position:fixed;
top:0; /* You would use these to move the button using em, pt, % or px. */
left:0;
right:0;
bottom:0;
}


I'm not sure if this is what you mean, but the way you described it is what I did above.

It's so that the button stays where it is when the user scrolls. Does position relative take in consideration of the viewport size?

VIPStephan
07-31-2012, 09:21 AM
Whatcha mean?

What I meant by saying “It depends on what you’re up to” is that we can’t give you any specific advice without seeing your code or knowing what kind of layout you wanna have, or for what reason you want screen size based positioning, respectively. Give us more context and we’ll find a way.



There's that thread of mine I was looking for haha. I knew I posted it a while back but could not find it. I am a newb with vbulletin forums.

You can find all threads you have ever posted here by clicking your user name at the left and then clicking the according link in the user statistics. Alternatively you can click the link “User CP” in the top left corner of the page and “Your Profile” in the left menu.

kin
07-31-2012, 09:56 PM
What I meant by saying “It depends on what you’re up to” is that we can’t give you any specific advice without seeing your code or knowing what kind of layout you wanna have, or for what reason you want screen size based positioning, respectively. Give us more context and we’ll find a way.



You can find all threads you have ever posted here by clicking your user name at the left and then clicking the according link in the user statistics. Alternatively you can click the link “User CP” in the top left corner of the page and “Your Profile” in the left menu.

Alrighty thanks, I fixed this issue late last night. Just created a separate div then used positioning for it. It worked on every browser and screen size I used.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum