Conditional Header in wordpress

It seems that you have forgotten to use <?php and ?> properly. Remember to open and close the php tag like the following:

<?php if ( is_singular( array( 'rivista', 'rivista-trimestrale' ) ) ) {?>
    <script>
        jQuery(function($){

        $('.parallax-window').parallax({imageSrc: '<?php echo  $ilgelo_options['ilgelo-parallax-image']['url'];?>'});
        });
    </script><?php
} else { ?>

<script>
        jQuery(function($){

        $('.parallax-window').parallax({imageSrc: 'STYLESHEETPATH."/img/header-rivista.jpg"'});
        });
    </script><?php
    } 
?>