PHP School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a PHP Expert!

Join 300,356 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,934 people online right now. Registration is fast and FREE... Join Now!




css php logical check on a divs height

 

css php logical check on a divs height

bobcahill

3 Jul, 2009 - 09:48 AM
Post #1

New D.I.C Head
*

Joined: 31 Aug, 2006
Posts: 2


My Contributions
I have a unordered list that is populated by PHP and styled with CSS.

CODE
<?php while (have_posts()): the_post(); ?>
<li class="date"><a href="<?php the_permalink(); ?>">
<?php the_time('F j, Y'); ?>
<?php the_time('g:i a'); ?>
</a></li>
<li class="entry"><a href="<?php the_permalink(); ?>">
<?php the_excerpt(); ?>
</a></li>
<?php endwhile; ?>


This list is vertical and needs to end at about 200 pixels in height. I can't control the height of each list item. Is there a progammatical way to measure the height of the css div area so PHP can pull out of the while loop so it stops displaying the information? I am thinking maybe some kind of if the div height < maxheight display the list item, else stop writing list items a pull out of the loop. Any pointers would be great.

User is offlineProfile CardPM
+Quote Post


bobcahill

RE: Css Php Logical Check On A Divs Height

3 Jul, 2009 - 10:04 AM
Post #2

New D.I.C Head
*

Joined: 31 Aug, 2006
Posts: 2


My Contributions
I guess a better form would be finding the y coordinate of the list item instead of the height of the div, that way it would be not CSS but purely where the element is on the page. So would I have to have Javascript find the y cooridinate? Or can PHP find it after each element is added?
User is offlineProfile CardPM
+Quote Post

TTechGuy

RE: Css Php Logical Check On A Divs Height

3 Jul, 2009 - 11:09 AM
Post #3

D.I.C Head
**

Joined: 24 Apr, 2009
Posts: 57



Thanked: 3 times
My Contributions
I don't know the specific answer to your question, but you could control the height of each list item if you truncated the display and added a hover over full description.

Then you know specifically what height each will be.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/7/09 07:29PM

Live PHP Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month