Jquery implements cool auto-switching on the stack layer _ jquery

Source: Internet
Author: User
This article is mainly to share with you a jquery auto-switching special effect for cool overlay layers. The effect is very good. We recommend this article to our friends. The following is the HTML code:

The Code is as follows:






Jquery overlay automatic page switching-ke leyi










  • 1. The following is a report by Ke leyi.




  • 2. These page segments will automatically switch.




  • 3. You can set the switching speed.




  • 4. You can also click the up or down arrow to control the switchover.




  • 5. You can also click a page to switch it to the frontend.




  • 6. For more information, visit the http://domain.com "style =" color: red "> http://domain.com </a>




  • 7. See the name of the song in the lyrics (3 ).




  • 8. He said it hurts in the wind and rain.




  • 9. Life is comparable to the waves at sea




  • 10. The gallbladder is like iron, and the bones are like gold steel.















Script
(Function (e) {$. fn. funnyNewsTicker = function (e) {var t = {width: "100%", modulid: "funnyNewsTicker", autoplay: true, timer: 3e3, titlecolor: "#333", titlefontsize: "16px", itembgcolor: "# FFF", contentlinkcolor: "#099", infobgcolor: "# f2f2f2", bordercolor: "# DDD", itemheight: 130, infobarvisible: false, btnfacebook: true, btntwitter: true, btngoogleplus: true, btnlinkbutton: true, btnlinktarget: "_ blank", pagecountvisible: true, buttonstyle: "black", pagenavi: true, pagenavistyle: "black", feed: false, feedcount: 100}; var e = $. extend (t, e); return this. each (function () {function o () {$ (e. modulid + "> p" ).css ({left: ($ (e. modulid ). width ()-30)/2} function u () {$ (e. modulid + "ul li "). eq (r [0]). addClass ("fnt-top0"); $ (e. modulid + "ul li "). eq (r [1]). addClass ("fnt-top1"); $ (e. modulid + "ul li "). eq (r [2]). addClass ("fnt-top2"); $ (e. modulid + "ul li "). eq (r [3]). addClass ("fnt-active"); $ (e. modulid + "ul li "). eq (r [4]). addClass ("fnt-bottom2"); $ (e. modulid + "ul li "). eq (r [5]). addClass ("fnt-bottom1"); $ (e. modulid + "ul li "). eq (r [6]). addClass ("fnt-bottom0")} function a () {t --; if (t <0) t = n; l ()} function f () {t ++; if (t = n + 1) t = 0; l ()} function l () {$ (e. modulid + "ul li "). attr ("class", ""); if (t = 0) {r [0] = n-2; r [1] = n-1; r [2] = n; r [3] = t; r [4] = t + 1; r [5] = t + 2; r [6] = t + 3} else if (t = 1) {r [0] = n-1; r [1] = n; r [2] = t-1; r [3] = t; r [4] = t + 1; r [5] = t + 2; r [6] = t + 3} else if (t = 2) {r [0] = n; r [1] = t-2; r [2] = t-1; r [3] = t; r [4] = t + 1; r [5] = t + 2; r [6] = t + 3} else if (t = n) {r [0] = n-3; r [1] = n-2; r [2] = n-1; r [3] = t; r [4] = 0; r [5] = 1; r [6] = 2} else if (t = n-1) {r [0] = n-4; r [1] = n-3; r [2] = n-2; r [3] = t; r [4] = t + 1; r [5] = 0; r [6] = 1} else if (t = n-2) {r [0] = n-5; r [1] = n-4; r [2] = n-3; r [3] = t; r [4] = t + 1; r [5] = t + 2; r [6] = 0} else {r [0] = t-3; r [1] = t-2; r [2] = t-1; r [3] = t; r [4] = t + 1; r [5] = t + 2; r [6] = t + 3} u ()} $ (e. modulid + "ul li" ).css ({height: e. itemheight, background: e. itembgcolor, border: "solid 1px" + e. bordercolor, color: e. titlecolor, "font-size": e. titlefontsize}); $ (e. modulid + "ul li "). each (function (t, r) {if (e. infobarvisible) {I ='

'; If (e. btnfacebook) I = I + ''; if (e. btntwitter) I = I + ''; if (e. btngoogleplus) I = I + ''; if (e. pagecountvisible) I = I + "" + ($ (this ). index () + 1) + "/" + (n + 1) + ""; if (e. btnlinkbutton) I = I + ''; I = I +"

"} $ (This ). append (I)}); $ (e. modulid + "ul li. fnt-content "). find ("a" character .css ({color: e. contentlinkcolor}); $ (e. modulid + "ul li "). find (". fnt-info "). find (""). click (function (e) {if ($ (this ). attr ("data-type") = "facebook") {window. open (" http://www.facebook.com/sharer.php?u= "+ EncodeURIComponent ($ (this ). attr ("data-url") + "& t =" + encodeURIComponent ($ (this ). attr ("data-text"), "sharer", "toolbar = 0, status = 0, width = 626, height = 436 "); return false} else if ($ (this ). attr ("data-type") = "twitter") {window. open (" http://twitter.com/share?text= "+ $ (This ). attr ("data-text") + "& url =" + $ (this ). attr ("data-url"), "sharer", "toolbar = 0, status = 0, width = 626, height = 436 "); return false} else if ($ (this ). attr ("data-type") = "google") {window. open (" https://plus.google.com/share?url= "+ $ (This ). attr ("data-url") + "& title =" + $ (this ). attr ("data-text"), "sharer", "height = 550, width = 525, left = 100, top = 100, menubar = 0 "); return false}); $ (e. modulid + "ul li "). click (function (e) {t = $ (this ). index (); l ()}); if (e. pagenavi) {$ (e. modulid ). append ('

'); ((E.modu)).css ({height: e. itemheight + 200, padding: "20px 10px", width: e. width})} else {detail (e.modulid).css ({height: e. itemheight + 160, padding: "0px 10px", width: e. width})} o (); $ (window ). resize (function (e) {o ()}); u (); $ (e. modulid + "> p "). click (function (e) {if ($ (this ). attr ("class") = "fnt-top-arrow") a (); else f ()}); if (e. autoplay) {s = setInterval (function () {f ()}, e. t Activities); $ (e. modulid ). hover (function () {clearInterval (s)}, function () {s = setInterval (function () {f ()}, e. timer)} function u () {$. ajax ({type: "GET", url: document. location. protocol + "// ajax.googleapis.com/ajax/services/feed/load? V= 1.0 & num = "+ e. feedcount +" & callback =? & Q = "+ encodeURIComponent (e. feed), dataType: "json", async: false, success: function (I) {veri = I. responseData. feed. entries; news = ""; $ (veri ). each (function (e, t) {if (e = 0) news = news +'
  • '+ Veri [e]. title +"

  • "; Else if (e = 1) news = news +'
  • '+ Veri [e]. title +"

  • "; Else if (e = 2) news = news +'
  • '+ Veri [e]. title +"

  • "; Else if (e = 3) news = news +'
  • '+ Veri [e]. title +"

  • "; Else if (e = veri. length-1) news = news +'
  • '+ Veri [e]. title +"

  • "; Else if (e = veri. length-2) news = news +'
  • '+ Veri [e]. title +"

  • "; Else if (e = veri. length-3) news = news +'
  • '+ Veri [e]. title +"

  • "; Else news = news +'
  • '+ Veri [e]. title +"

  • "}); $ (E. modulid + "ul" ).html (""); $ (e. modulid + "ul "). append (news); n = veri. length-1; r = [n-2, n-1, n, t, t + 1, t + 2, t + 3]; o ()}, error: function () {$ (e. modulid + "ul" ).html ('
  • Error! Please try again later...

  • ') }}E. modulid = "#" + $ (this ). attr ("id"); var t = 0; var n = $ (e. modulid + "ul li "). length-1; var r = [n-2, n-1, n, t, t + 1, t + 2, t + 3]; var I = ""; var s = e. modulid; if (e. feed! = False) {$ (e. modulid + "ul" ).html (""); $ (e. modulid + "ul"). append ('
  • Rss Feed Loading...

  • '); U ()} else {o ()}) (jQuery)
    $ (Document). ready (function (){
    $ ("# FunnyNewsTicker2 "). funnyNewsTicker ({width: "80%", timer: 4000, titlecolor: "# FFF", itembgcolor: "# 1faf6d", infobgcolor: "# 1a935c", buttonstyle: "white ", bordercolor: "# 1a935c "});
    $ ("# FunnyNewsTicker3 "). funnyNewsTicker ({width: "60%", itemheight: 250, infobarvisible: false, pagenavi: false, timer: 500, itembgcolor: "# af1f63", bordercolor: "# af1f63 ", titlecolor: "# FFF "});
    });
    Script


    Applicable browsers: IE8, 360, FireFox, Chrome, Safari, Opera, aoyou, sogou, and windows of the world.





    The above is all the code for this sharing. I hope you will like it.

    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.