Sometimes yes, sometimes no.
First understand what a response layout is: an adaptive layout is one that dynamically changes itself. Depending on the size of the browser screen. So it is perfect for every type of screen, size, resolution, etc. So the site layout will not break.
You can simply use the CSS3 media query to change the layout, otherwise you can use jQuery or some other JavaScript to make this happen.
But remember, JavaScript is not required to make a document responsive.
Sometimes yes!
Sometimes a developer writes code using JavaScript, for example, the jQuery API. Therefore, it would be easy for him to write code in jQuery to dynamically process all events in a browser window to make the site Responsive.
It would be easy for me to write code in jQuery compared to CSS. Therefore, for this purpose I will have to add the jQuery source file to the document to make it that way. Otherwise, I will not be able to create responsiveness on the Site or I will not adhere to pure JavaScript
Example:
if($(window).width() > '1300') { $('body').css({ 'height': '100%' }); }
Sometimes not!
Some developers are well versed in CSS (CSS3 and its media queries). Therefore, they try to use CSS3 to render the document and make it responsive.
CSS3 is indeed much simpler than jQuery, and it would be useful to use it. It will also not require the inclusion of any of the Script files. You can easily write the code in the default CSS file. And changes will be made accordingly.
@media only screen and (max-width: 1300px) { body { height: 100%; } }
But remember
If you use simple CSS and then use CSS3 Media Queries to change the layout of the website, you can simply determine the screen size and other elements. You cannot check the properties of the browser or the contents on the screen, etc.
Afzaal ahmad zeeshan
source share