Very cool jQuery/HTML5 image slider effect with elastic menu

Source: Internet
Author: User

At the beginning of the new week, when I was sitting in front of my desk, I went to view some jQuery and HTML5 application plug-ins, today, let's take a look at a very cool jQuery/HTML5 image slider special effect. This plug-in features a good elastic menu on the image. When you move the mouse over the menu, a translucent image will pop up. Let's take a look.

Of course, we can't simply look at the effect, or simply analyze the source code.

First, use the simplest HTML code to construct the image slider frame with menus:

                                                                                                                                                                                    Web Print Logos Photos                                

The following is the CSS3 code, which is mainly used to render the left and right arrows and Image Shadow effects. Here we paste the core CSS code:

{:;:;:;:;:;:;    }{:;    }{:;    }{:;    }{:;:;:;:;:;:;:;:;    }{:;:;:;:;:;:;:;:;:;    }

The focus is on jQuery code. The following jQuery code implements the slider animation of the image and the elastic animation effect when the mouse slides over the menu:

$( sliderInterval = setInterval(7000'.nav-arrow').click(($().attr('id') == 'arrow-left''#dots li').click( thisIndex = $((thisIndex < $('#dots li.active' (thisIndex > $('#dots li.active''#dots li.active').removeClass('active').addClass('active' curIndex = $('#image-slider li.active-img'(curIndex == 0'#image-slider li:last-child').addClass('next-img'0'#image-slider li.active-img').removeClass('active-img').css('left', '-923px''#image-slider li.next-img').attr('class', 'active-img' nextIndex = $('#image-slider li.active-img''#dots li.active').removeClass('active''#dots li').eq(nextIndex).addClass('active''#image-slider li.active-img').prev().addClass('next-img'0'#image-slider li.active-img').removeClass('active-img').css('left', '-923px''#image-slider li.next-img').attr('class', 'active-img' nextIndex = $('#image-slider li.active-img''#dots li.active').removeClass('active''#dots li').eq(nextIndex).addClass('active' curIndex = $('#image-slider li.active-img'(curIndex == $('#image-slider li').length - 1'#image-slider li:first-child').addClass('next-img').css('left', 9230'#image-slider li.active-img').removeClass('active-img').css('left', '-923px''#image-slider li.next-img').attr('class', 'active-img' nextIndex = $('#image-slider li.active-img''#dots li.active').removeClass('active''#dots li').eq(nextIndex).addClass('active''#image-slider li.active-img').next().addClass('next-img').css('left', 9230'#image-slider li.active-img').removeClass('active-img').css('left', '-923px''#image-slider li.next-img').attr('class', 'active-img' nextIndex = $('#image-slider li.active-img''#dots li.active').removeClass('active''#dots li').eq(nextIndex).addClass('active''#image-slider li').eq(newIndex).addClass('next-img'0'#image-slider li.active-img').removeClass('active-img').css('left', '-923px''#image-slider li.next-img').attr('class', 'active-img''#image-slider li').eq(newIndex).addClass('next-img').css('left', 9230'#image-slider li.active-img').removeClass('active-img').css('left', '-923px''#image-slider li.next-img').attr('class', 'active-img'

Very concise JS Code.

Finally, we can only see the basic slider effect in IE6.7.8. The source code is attached.>

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.