Dynamically display images in a container depending on page height

General discussions related to php

Moderators: egami, macek, gesf

Post Reply
guvna
New php-forum User
New php-forum User
Posts: 15
Joined: Fri Mar 10, 2017 7:42 am

Tue Mar 26, 2019 5:14 am

First of all, if this topic is already covered please provide the search term I should have used to find it.

I am trying to construct pages that have different content so they vary in height depending on their content. Using PHP I'd like to display images in a container <div> by the side of my content but I don't want to hard code them.

So I have say 10 images that could be defined as 01-10 that I'm looking to display vertically. The number displayed could be 4 or they could need to be repeated for the pages with more content.

I searched online but keep getting directed to background image repeats for single image files and that's not what I'm looking for.

chorn
php-forum Fan User
php-forum Fan User
Posts: 601
Joined: Fri Apr 01, 2016 2:18 am

Tue Mar 26, 2019 5:34 am

PHP is serverside and knows nothing about any height a browser is rendering.

guvna
New php-forum User
New php-forum User
Posts: 15
Joined: Fri Mar 10, 2017 7:42 am

Wed Mar 27, 2019 10:25 am

Is there any method of doing the container height calculation clientside and using the result to render 'x' number of images serverside or is it something that simply isn't done?

User avatar
hyper
php-forum Fan User
php-forum Fan User
Posts: 839
Joined: Mon Feb 22, 2016 5:52 pm

Wed Mar 27, 2019 4:18 pm

Is there any method of doing the container height calculation clientside
Not easily or consitantly, there are too many variations in the way browsers do things.
to use the result to render 'x' number of images serverside
By rendering dynamic images, you would change the size of the page.
or is it something that simply isn't done?
Pretty much.

What is the pixel size that you are going to be sending pages to?

chorn
php-forum Fan User
php-forum Fan User
Posts: 601
Joined: Fri Apr 01, 2016 2:18 am

Wed Mar 27, 2019 11:11 pm

I would do something like giving a serverside list of possible images to javascript and then let it calculate how many/which images are to be displayed.

guvna
New php-forum User
New php-forum User
Posts: 15
Joined: Fri Mar 10, 2017 7:42 am

Thu Mar 28, 2019 4:11 am

Each image is width:125px height:94px and I have eight before I need to duplicate. They are controlled by this css:
.tblRetailImgBdr {
background-color:#FFFFFF;
border:none;
padding:none;
text-align:left;
vertical-align:top;
width:125px;
}

matthewbaron
New php-forum User
New php-forum User
Posts: 1
Joined: Tue Apr 16, 2019 3:28 am

Tue Apr 16, 2019 3:32 am

How it is done? What can influence this procedure? I cannot see your comments on this issue. Will you please share them with us?
http://findwritingservice.com/blog/we-do-your-essay-with-the-great-satisfaction

michaelmcgrath
New php-forum User
New php-forum User
Posts: 1
Joined: Thu Apr 18, 2019 3:09 am

Thu Apr 18, 2019 3:11 am

The previously existing topic covered all the necessary details. Anyway, thank you for submitting a new one. Maybe someone would be able to assist you!
http://findwritingservice.com/blog/top-significant-events-of-2000s

Post Reply