Array of string turns

Source: Internet
Author: User
Tags prev

Cuts a string into several strings by one character and returns as an array

var s = "Abc,abcd,aaa"= S.split (",");  // decompose at each comma (,). Console.log (ss);  // ["abc", "ABCD", "AAA"]

_720 in the Intercept array is replaced by _360:

functionchangelargeimg (self) {imgclear (); $("section"). Show (); //Big Picture    varDATALARGESRC = $ (self). attr ("Data-largesrc"); DATALARGESRC= Datalargesrc.split (","); vartophtml = "<div class= ' Swiper-wrapper ' >";  for(varIinchdatalargesrc) {tophtml+ = "<div class= ' swiper-slide ' style= ' Background-image:url (" +datalargesrc[i]+ ") ' ></div> '; } tophtml+ = "</div>"; $(". Gallery-top"). Append (tophtml); varBTN = "<div class= ' swiper-button-next swiper-button-white ' ></div><div class= ' Swiper-button-prev Swiper-button-white ' ></div> "; $(". Gallery-top"). Append (BTN); //clone, small picture    varDATASRC =Datalargesrc.slice (); varDATA360SRC = [];  for(varIinchdatasrc) {Data360src.push (Datasrc[i].replace (/_720/, "_360"));//Replace finds and replaces, returns a new array, and the push is placed into the new array;    }    varthumbshtml = "<div class= ' Swiper-wrapper ' >";  for(varIinchdata360src) {thumbshtml+ = "<div class= ' swiper-slide ' style= ' Background-image:url (" +data360src[i]+ ") ' ></div> '; } thumbshtml+ = "</div>"; $(". Gallery-thumbs"). Append (thumbshtml); //swiper image Dynamic activation    varGallerytop =NewSwiper ('. Gallery-top '), {nextbutton:'. Swiper-button-next ', Prevbutton:'. Swiper-button-prev ', Spacebetween:10    }); varGallerythumbs =NewSwiper ('. Gallery-thumbs '), {spacebetween:10, Centeredslides:true, Slidesperview:' Auto ', Touchratio:0.2, Slidetoclickedslide:true    }); //bidirectional ControlGalleryTop.params.control =Gallerythumbs; GalleryThumbs.params.control=gallerytop;}

Array of string turns

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.