I have the following JS which uses fadeToggle()
which works fine however it does a display:none
so the 3rd element which I always display jumps up so wondering if its possible to change to change the opacity
to 0
so in theory the block is still there and nothing moves.
JS
$('.ty-banner__image-item.gt-banner').bind('touchstart touchend', function(e) {
$(this).find('div.image .banner-overlay').fadeToggle('fade');
$(this).find('.content h2, .content p:first-child, .content p:eq(1)').fadeToggle();
});
Can I toggle to set opacity
to 0
on a toggle?
updated to use toggle class to add class fade which just changes opacity: 0
but need to fade it some how.
// mobile touch rubbish
$('.ty-banner__image-item.gt-banner').bind('touchstart touchend', function(e) {
$(this).find('div.image .banner-overlay').toggleClass('fade');
$(this).find('.content h2, .content p:not(".button")').toggleClass('fade');
});