Raphael Bergeron Raphael Bergeron - 6 months ago 12
Javascript Question

Resizing images when screen is less than 1024 pixels width

I tried to make my images smaller when screen width is less than 1024 but it's not working. Can someone help?

<script type="text/javascript">
if( $(window).width() < 1024)
{
$(".imagelist").animate({ width: '2750px',height:'540px'})1000
$("img").animate({ width: '250px',height:'250px'})1000
}
});
</script>

tfg tfg
Answer

Like Mohamed-Yousef said, you are missing a comma. But there are also some other syntax issues. Try:

<script type="text/javascript">
    if( $(window).width() < 1024)
    {
        $(".imagelist").animate({width:'2750px',height:'540px'}, 1000);
        $("img").animate({ width:'250px',height:'250px'}, 1000);
    }
</script>
Comments