JQuery automatic text and text broadcast effect plug in

  • 2020-06-19 09:42:02
  • OfStack

An example of JQuery is presented in this paper. Share to everybody for everybody reference. The details are as follows:


intervalID = setInterval(cycleImage, slidetime);
$(".main_image .desc").show(); //  Show the picture 
$(".main_image .block").animate({ opacity: 0.85 }, 1 ); //  Set transparency 
// Click and hover events 
$(".image_thumb ul li:first").addClass('active'); 
$(".image_thumb ul li").click(function(){ 
//  Set the parameters 
var imgAlt = $(this).find('img').attr("alt"); 
var imgTitle = $(this).find('a').attr("href"); 
var imgDesc = $(this).find('.block').html(); //  From the class block To derive html
var imgDescHeight = $(".main_image").find('.block').height();
//  Calculate the class block The height of the 
if ($(this).is(".active")) { //  If it is already active, the next action ...
return false; 
} else {
//  Animation operation 
$(".main_image .block").animate({ opacity: 0, marginBottom: -imgDescHeight }, 250 , function() {
$(".main_image .block").html(imgDesc).animate({ opacity: 0.85,marginBottom: "0" }, 250 );
$(".main_image img").attr({ src: imgTitle , alt: imgAlt});
});
}
$(".image_thumb ul li").removeClass('active'); 
$(this).addClass('active'); 
return false;
}) .hover(function(){
$(this).addClass('hover');
}, function() {
$(this).removeClass('hover');
});
// Toggle Teaser
$("a.collapse").click(function(){
$(".main_image .block").slideToggle();
$("a.collapse").toggleClass("show");
});

Hopefully, this article has been helpful in your jQuery programming.


Related articles: