欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

自定義刻度jQuery進(jìn)度條及插件

 更新時(shí)間:2015年09月02日 09:11:42   投稿:mrr  
自定義刻度jq進(jìn)度條可以自定義進(jìn)度條刻度圓點(diǎn)數(shù)量,大小等相關(guān)屬性,可以通過(guò)css控制圓點(diǎn)的外觀樣式,通過(guò)progressdots插件自定義刻度動(dòng)畫(huà),使用該插件還需引入jquery,jquery.progressdots.js和jquery.progressdots.css文件。需要的朋友一起學(xué)習(xí)吧

簡(jiǎn)要教程 progressdots是一款可自定義刻度動(dòng)畫(huà)的jQuery進(jìn)度條插件。通過(guò)該jQuery進(jìn)度條插件你可以自定義進(jìn)度條刻度圓點(diǎn)的數(shù)量,大小,顏色等屬性,并且可以通過(guò)CSS來(lái)控制圓點(diǎn)的外觀樣式。

請(qǐng)看下面效果圖了解相關(guān)插件。

使用該jQuery進(jìn)度條插件需要引入jquery,jquery.progressdots.js和jquery.progressdots.css文件。

<script src="jquery.min.js"></script> 
<script src="jquery.progressdots.js"></script>
<link href="jquery.progressdots.css" rel="stylesheet">

HTML結(jié)構(gòu)

然后使用一個(gè)空的<div> 元素來(lái)作為進(jìn)度條的容器。

容器的寬度和高度任意。

<div id='progressBox'></div> 

為進(jìn)度條容器設(shè)置一些基本樣式,指定它的寬度和高度。

#progressBox{ border: 8px solid #DDD; width: 80%; height: 40px; }

調(diào)用插件

在頁(yè)面DOM元素加載完畢之后,可以通過(guò)下面的方法來(lái)初始化該進(jìn)度條插件

$( '#progressBox' ).dottify({ dotSize: '25px', 
//set size of dot dotColor: '#f15c89',
//set dot color (#HEX) progress: true, 
//enable progress percent: 10, //set initial percentage radius: '40%'
//set dot corner radius }); 

高級(jí)選項(xiàng)

var progressBox = $( '#progressBox' ).dottify({ progress:true,
//start with progressbar on percent:0 }); progressBox.setProgress( 20 );
//update progress percentage 

可自定義刻度jQuery進(jìn)度條是一款可以自定義進(jìn)度條刻度圓點(diǎn)的數(shù)量,大小,顏色等屬性,并且可以通過(guò)CSS來(lái)控制圓點(diǎn)的外觀樣式。

效果圖如下:

查看演示  在線下載

html代碼:

<div class="htmleaf-container">
 <div id="container">
  <div class="padded">
  <div id="progressHolder"></div>
  <div id="progressReset">生成隨機(jī)的風(fēng)格</div>
  </div>
 </div>
 </div>
 <script src="js/jquery-2.1.1.min.js" type="text/javascript"></script>
 <script src="js/jquery.progressdots.js"></script>
 <script src="js/prism.js"></script>
 <script>
 $(document).ready(function () {
  createSpots(1);
  $("#progressReset").click(function (event) {
  event.preventDefault();
  createSpots(1);
  });
  function createSpots(num) {
  for (var i = 0; i < num; i++) {
   options = {
   dotSize: random(10, 20) + "px",
   radius: random(1, 7) * 10 + "%"
   };
   randomHtml = "";
   if (Math.random() < 0.5) {
   options.randomColors = true;
   randomHtml += "\n\trandomColors: " + options.randomColors + ", //use random colors";
   }
   else {
   options.dotColor = randomColor();
   randomHtml += "\n\tdotColor: '" + options.dotColor + "', //set dot color (#HEX)";
   }
   if (Math.random() < 0.3) {
   options.progress = true;
   options.percent = random(5, 100);
   randomHtml += "\n\tprogress: true, //enable progress";
   randomHtml += "\n\tpercent: " + options.percent + ", //set initial percentage";
   } else {
   options.numDots = random(3, 15);
   randomHtml += "\n\tnumDots: " + options.numDots + ", //number of dots";
   }
   string = "$( '#progressBox' ).dottify({\
   \n\tdotSize: '" + options.dotSize + "', //set size of dot" +
    randomHtml +
    "\n\tradius: '" + options.radius + "' //set dot corner radius\
  \n});";
   var $container = $("<div class='swoopContainer'></div>").data("setupString", JSON.stringify(string));
   $("#progressHolder").append($container.hide());
   $container.slideDown(function () {
   $(this).css({ overflow: "hidden" });
   });
   $container.click(function () {
   $(".swoopContainer").removeClass("selected");
   $(this).addClass("selected");
   $("#jsContents").html(JSON.parse($(this).data("setupString")));
   Prism.highlightAll();
   });
   $container.dottify(options);
   $("#jsContents").html(string);
   Prism.highlightAll();
  }
  $(".swoopContainer").removeClass("selected");
  $(".swoopContainer").last().addClass("selected");
  }
  function randomColor() {
  return '#' + Math.floor(Math.random() * 16777215).toString(16);
  }
  function random(min, max) {
  return Math.floor(Math.random() * ((max - min) + min) + min);
  }
 });
 </script>

相關(guān)文章

  • JQuery學(xué)習(xí)總結(jié)【二】

    JQuery學(xué)習(xí)總結(jié)【二】

    本文主要介紹了JQuery的基本知識(shí),如:JQuery的dom操作,動(dòng)態(tài)創(chuàng)建dom節(jié)點(diǎn),刪除節(jié)點(diǎn),document方法等等,文章篇尾處附上實(shí)例小練習(xí)。需要的朋友可以參考下
    2016-12-12
  • jquery實(shí)現(xiàn)的偽分頁(yè)效果代碼

    jquery實(shí)現(xiàn)的偽分頁(yè)效果代碼

    這篇文章主要介紹了jquery實(shí)現(xiàn)的偽分頁(yè)效果代碼,涉及jQuery頁(yè)面元素操作與數(shù)值計(jì)算的相關(guān)技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下
    2015-10-10
  • jQuery代碼實(shí)現(xiàn)發(fā)展歷程時(shí)間軸特效

    jQuery代碼實(shí)現(xiàn)發(fā)展歷程時(shí)間軸特效

    這篇文章主要介紹了jQuery代碼實(shí)現(xiàn)發(fā)展歷程時(shí)間軸特效代碼,帶有左右箭頭,數(shù)字時(shí)間軸選項(xiàng)卡切換特效,有需要的小伙伴們可以來(lái)參考下
    2015-07-07
  • 基于jquery 的一個(gè)progressbar widge

    基于jquery 的一個(gè)progressbar widge

    這個(gè)widget是包含在wijmo 項(xiàng)目中的一個(gè)widget。目前此widget已經(jīng)開(kāi)源基于mit和gpl雙協(xié)議,目前是beta版,可能存在bug。
    2010-10-10
  • 基于Jquery的動(dòng)態(tài)添加控件并取值的實(shí)現(xiàn)代碼

    基于Jquery的動(dòng)態(tài)添加控件并取值的實(shí)現(xiàn)代碼

    基于Jquery的動(dòng)態(tài)添加控件并取值的實(shí)現(xiàn)代碼,需要的朋友可以參考下。
    2010-09-09
  • jQuery的框架介紹

    jQuery的框架介紹

    jQuery使用有一段時(shí)間了,但是有一些API的實(shí)現(xiàn)實(shí)在想不通。小編參考相關(guān)資料源碼,現(xiàn)在把我的學(xué)習(xí)過(guò)程和收獲分享給大家
    2016-05-05
  • jQuery 表格工具集

    jQuery 表格工具集

    本文搜集了大量 jQuery 表格插件,幫助 Web 設(shè)計(jì)者更好地駕御 HTML 表格,你可以對(duì)表格進(jìn)行橫向和豎向排序,設(shè)置固定表頭,對(duì)表格進(jìn)行搜索,對(duì)大表格進(jìn)行分頁(yè),對(duì)表格進(jìn)行滾動(dòng),拖放操作等等。這些插件很多都包含詳細(xì)的教程。
    2010-04-04
  • jQuery添加和刪除輸入文本框標(biāo)簽代碼

    jQuery添加和刪除輸入文本框標(biāo)簽代碼

    本文是基于jquery代碼實(shí)現(xiàn)的添加和刪除輸入文本框標(biāo)簽代碼,非常不錯(cuò),具有參考借鑒,需要的朋友一起看下吧
    2016-05-05
  • Jquery遍歷select option和添加移除option的實(shí)現(xiàn)方法

    Jquery遍歷select option和添加移除option的實(shí)現(xiàn)方法

    下面小編就為大家?guī)?lái)一篇Jquery遍歷select option和添加移除option的實(shí)現(xiàn)方法。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2016-08-08
  • jquery easyui DataGrid簡(jiǎn)單示例

    jquery easyui DataGrid簡(jiǎn)單示例

    本篇文章主要介紹了jquery easyui DataGrid簡(jiǎn)單示例,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2017-01-01

最新評(píng)論