Categories

Featured templates

JS Animated. How to prevent slide images from being cut off on the mobile views

Guillaume Dumas May 22, 2015
Rating: 5.0/5. From 2 votes.
Please wait...

This tutorial shows how to change slides dimensions in JS Animated templates for mobile devices so that the images will keep their natural ratio and therefore won’t be cut off at the edges.

JS Animated. How to prevent slide images from being cut off on the mobile views

By default, slides will get cut off at the right and left edges when viewed on small devices to make the slider height as big as possible: JS_Animated._How_to_prevent_slide_images_from_being_cut_off_on_the_mobile_views-1

Simple CSS modification cat make them appear with the natural Width/Height ratio.

In order to change the slide dimensions for mobile devices, you should perform the following:

  1. Open up the css/camera.css.js file and scroll down to the very bottom.

  2. Add the following code that will change the image dimensions for mobile devices and position them correctly inside the slider:

    			@media (max-width: 768px) {
    			.slider img {
    			width: 100% !important;
    			height: auto !important;
    			margin-left: 0 !important;
    			}
    			}
    		
  3. Add the following code that will change the height of the slider to remove the free space under the slides:

    			@media (max-width: 479px) {
    			.camera_wrap {
    			height: 126px !important;
    			}
    			}
    		
  4. Save the changes in the css/camera.css.js file and upload it to the server.

    The result should look like this:

    JS_Animated._How_to_prevent_slide_images_from_being_cut_off_on_the_mobile_views-2

Feel free to check the detailed video tutorial below:

JS Animated. How to prevent slide images from being cut off on the mobile views
This entry was posted in JS Animated tutorials and tagged cut, HTML, images, mobile, slider. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket