purge08 Posted January 9, 2020 Share Posted January 9, 2020 After my navbar on desktop and large devices I want to make 20% floating on the left to show top 8 products sold and float on the right #myCarousel on large devices. But on small devices such as iPhones or tablets to have the #myCarousel on top with top 8 sold product list going down below the carousel. How can I do this? I have script for the carousel, but need help on how to make script for the top products as text highlighted as if a href with hover of product image. Plus how to make a table to pull that data into it for showing those products. Quote Link to comment https://forums.phpfreaks.com/topic/309811-question-about-container-and-sizes/ Share on other sites More sharing options...
gw1500se Posted January 9, 2020 Share Posted January 9, 2020 Javascript screen.height and screen.width will give you the measurements regardless of device type. From that you can calculate how you want to distribute the screen real estate. Pass that info back to PHP via Ajax and set up the output as desired. Quote Link to comment https://forums.phpfreaks.com/topic/309811-question-about-container-and-sizes/#findComment-1573217 Share on other sites More sharing options...
ginerjm Posted January 9, 2020 Share Posted January 9, 2020 This really is a question for a CSS forum, don't you think? Quote Link to comment https://forums.phpfreaks.com/topic/309811-question-about-container-and-sizes/#findComment-1573222 Share on other sites More sharing options...
requinix Posted January 9, 2020 Share Posted January 9, 2020 There really ought to be a good, clean CSS answer to this. Quote Link to comment https://forums.phpfreaks.com/topic/309811-question-about-container-and-sizes/#findComment-1573224 Share on other sites More sharing options...
purge08 Posted January 9, 2020 Author Share Posted January 9, 2020 I am looking in regard to Php code. Not css. Quote Link to comment https://forums.phpfreaks.com/topic/309811-question-about-container-and-sizes/#findComment-1573226 Share on other sites More sharing options...
gizmola Posted January 9, 2020 Share Posted January 9, 2020 Porbably the best solution in this case is to use media queries Here's an example that might help that targets phone sizes: /* Smartphones (portrait and landscape) ----------- */ @media only screen and (min-width: 320px) and (max-width: 480px) { .logo img { width: 60px; } /* other css rules */ } You can make alterations to the rules that drive the carousel using this technique, perhaps hiding it or doing something else. Quote Link to comment https://forums.phpfreaks.com/topic/309811-question-about-container-and-sizes/#findComment-1573228 Share on other sites More sharing options...
purge08 Posted January 10, 2020 Author Share Posted January 10, 2020 So, basically using laravel might be better at accomplishing it? Quote Link to comment https://forums.phpfreaks.com/topic/309811-question-about-container-and-sizes/#findComment-1573232 Share on other sites More sharing options...
maxxd Posted January 10, 2020 Share Posted January 10, 2020 (edited) On 1/9/2020 at 6:24 PM, purge08 said: So, basically using laravel might be better at accomplishing it? No, using CSS will definitely be better at accomplishing it. You're talking about responsive web design, which is not accomplished with PHP. Stop trying to use a bazooka to kill a gnat. Edited January 13, 2020 by cyberRobot Quote Link to comment https://forums.phpfreaks.com/topic/309811-question-about-container-and-sizes/#findComment-1573233 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.