


Image and text automatic carousel effect plug-in implemented by JQuery
Jun 28, 2018 pm 02:23 PMThis article mainly introduces the image and text automatic carousel effect plug-in implemented by JQuery, involving jQuery's method of processing mouse events and animation effects. Friends in need can refer to it
The example of this article describes the implementation of JQuery Automatic image and text carousel effect plug-in. Share it with everyone for your reference. The details are as follows:
intervalID = setInterval(cycleImage, slidetime); $(".main_image .desc").show(); // 展示图片 $(".main_image .block").animate({ opacity: 0.85 }, 1 ); // 设置透明度 //点击和悬停事件 $(".image_thumb ul li:first").addClass('active'); $(".image_thumb ul li").click(function(){ // 设置参数 var imgAlt = $(this).find('img').attr("alt"); var imgTitle = $(this).find('a').attr("href"); var imgDesc = $(this).find('.block').html(); // 从类block中获取html var imgDescHeight = $(".main_image").find('.block').height(); // 计算类block的高度 if ($(this).is(".active")) { // 如果已经激活了,之后的操作... return false; } else { // 动画操作 $(".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"); });
The above is the entire content of this article. I hope it will be helpful to everyone’s study. Please pay attention to more related content. PHP Chinese website!
Related recommendations:
jQuery realizes the switching page transition animation effect
jQuery and CSS3 realize the like function
The above is the detailed content of Image and text automatic carousel effect plug-in implemented by JQuery. For more information, please follow other related articles on the PHP Chinese website!

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Detailed explanation of jQuery reference methods: Quick start guide

How to use PUT request method in jQuery?

How to remove the height attribute of an element with jQuery?

jQuery Tips: Quickly modify the text of all a tags on the page

Use jQuery to modify the text content of all a tags

Understand the role and application scenarios of eq in jQuery

How to tell if a jQuery element has a specific attribute?

Summary of commonly used file operation functions in PHP
