JQuery implements the accordion effect with glass-colored texture, and jquery accordion

Source: Internet
Author: User
Tags jquery accordion

JQuery implements the accordion effect with glass-colored texture, and jquery accordion

JQuery implements an accordion effect with a glass streamer texture. It is an accordion effect with a glass streamer Texture Based on jQuery + CSS3. The details are as follows:

:

The Code is as follows:

Html code:

<section class="strips">   <article class="strips__strip">     <div class="strip__content">       

Js Code:

      var Expand = function () {      var tile = $('.strips__strip');      var tileLink = $('.strips__strip > .strip__content');      var tileText = tileLink.find('.strip__inner-text');      var stripClose = $('.strip__close');      var expanded = false;      var open = function () {        var tile = $(this).parent();        if (!expanded) {          tile.addClass('strips__strip--expanded');          tileText.css('transition', 'all .6s 1s cubic-bezier(0.23, 1, 0.32, 1)');          stripClose.addClass('strip__close--show');          stripClose.css('transition', 'all .6s 1s cubic-bezier(0.23, 1, 0.32, 1)');          expanded = true;        }      };      var close = function () {        if (expanded) {          tile.removeClass('strips__strip--expanded');          tileText.css('transition', 'all 0.15s 0 cubic-bezier(0.23, 1, 0.32, 1)');          stripClose.removeClass('strip__close--show');          stripClose.css('transition', 'all 0.2s 0s cubic-bezier(0.23, 1, 0.32, 1)');          expanded = false;        }      };      var bindActions = function () {        tileLink.on('click', open);        stripClose.on('click', close);      };      var init = function () {        bindActions();      };      return { init: init };    }();    Expand.init();

I hope this article will inspire you and help you better learn jquery programming.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.