javascript - Hide / show text instead of image -
when hover pseudo - link top menu want display corresponding text
instead of image
.
i got similar.
faced problem text not rise place images , script being processed moves down lower block content.
$('.spoiler').hide(); $('.pseudo-top-menu .pseudo-link').on({ mouseenter: function() { var index = $(this).parent().index() + 1; $('.t' +index).fadeout(); $('.t' +index+ '+.spoiler').fadein(); }, mouseleave: function() { var index = $(this).parent().index() + 1; $('.t' +index+ '+.spoiler').fadeout(); $('.t' +index).fadein(); } });
to have span floating on image, make span position:absolute
, , container postion:relative
.teasers-menu li{ position:relative; } .teaser, .spoiler { position:absolute; }
Comments
Post a Comment