I would like to find a way to dynamically adjust the number of modules based on main-content height. Is it possible and how ? in css ? javascript ?
The purpose is to avoid having blank page if there is no content.
Thanks in advance
Vanessa
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This could be accomplished in many ways, some more elegant than others.
The most simple one I could think of is to use Javascript only:
Something like: (Code not tested)
Note that this assumes you are using mootools (which is probably already provided by your Joomla installation). Also, my element selectors may not work with your template.
Again, the server will still send all modules even if some are to be removed. Another thing is that this will start when the DOM of your webpage has been fully loaded, meaning the user might see modules disappearing. Therefore it could also be nicer to hide all the modules at the start and then use a similar loop to display the modules one by one.
EDIT:
Another sample you may prefer.