jquery - How to implement carousel display of data with Javascript and Css -


i implementing carousel, holding sets of metrics.

the next slides (data set) implemented hidden beyond border, carousel movement can occur moving next hidden data set visible area. width of each data set modified based on number of elements (data sets). below links have far: https://jsfiddle.net/chouchua/b94gc1rr/

snippet of code set width of carousel contents:

function setwidth(){   var ulmetrics = $('ul');   console.log('number of datametrics:');   var metriclength = ulmetrics.length;   var containerlength = metriclength + "00%";   console.log(containerlength);   var datalength= (100/metriclength - 5) + "00%";   console.log('dataset width is: '.concat(datalength));   if(metriclength){     //set width of data container     $('.data_container').css("width", containerlength);     //set width of data sets     $('.metric').css("width", datalength);   }  } 

please suggest best ways move next slide sliding effect, in consideration of calculating new position , checking whether there exists next set of data. note current movement implementation not support multiple clicks, please give suggestions well.

i prefer javascript solution, jquery solutions works too.

thanks much.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -