custom post for slider

Preblem is because inside loop you have UL

echo '<ul>';
    while ( $loop->have_posts() ) : $loop->the_post();
        ?>
        <li data-transition="fade" data-slotamount="6">
            <?php
        echo wp_get_attachment_image( get_post_thumbnail_id(), 'full', false, array( 'class' => 'thumbnail zoom' ) );?>
        <p><a href="#."><?php the_title();?></a></p>
        </li>
       <?php 
    endwhile;echo '</ul>';

Just make one IF statment before echo-ing UL tag

     $loop = new WP_Query( $args );
    if($loop-have_posts()):
  echo '<ul>';
    while ( $loop->have_posts() ) : $loop->the_post();
      ?>
        <li data-transition="fade" data-slotamount="6">
            <?php
        echo wp_get_attachment_image( get_post_thumbnail_id(), 'full', false, array( 'class' => 'thumbnail zoom' ) );?>
        <p><a href="#."><?php the_title();?></a></p>
        </li>
       <?php
    endwhile;  echo '</ul>';endif; wp_reset_postdata();?>