簡(jiǎn)要教程
svg3dtagcloud.js是一款基于HTML5?SVG的3D標(biāo)簽云jQuery插件。該3D標(biāo)簽云插件不需要額外的CSS樣式,可使用鼠標(biāo)與標(biāo)簽進(jìn)行互動(dòng),并提供很多參數(shù)來控制標(biāo)簽云的外觀。
?使用方法
使用該3D標(biāo)簽云插件需要引入jQuery和jquery.svg3dtagcloud.min.js文件。
<script src="js/jquery.min.js"></script> <script src="js/jquery.svg3dtagcloud.min.js"></script>
HTML結(jié)構(gòu)
可以使用一個(gè)
容器來作為該3D標(biāo)簽云的包裹容器
<p id="tag-cloud"></p>
初始化插件
首先你需要設(shè)置一個(gè)對(duì)象數(shù)組遍歷,數(shù)組中包含你需要制作的標(biāo)簽和它們對(duì)應(yīng)的鏈接地址。
var entries = [ { label: 'CodePen', url: 'http://codepen.io/', target: '_top' }, { label: 'three.js', url: 'http://threejs.org/', target: '_top' }, { label: 'JS Compress', url: 'http://jscompress.com/', target: '_top' }, { label: 'TinyPNG', url: 'https://tinypng.com/', target: '_top' }, { label: 'Can I Use', url: 'http://caniuse.com/', target: '_top' }, { label: 'URL shortener', url: 'https://goo.gl/', target: '_top' }, { label: 'Twitter', url: 'https://twitter.com/', target: '_top' }, { label: 'Gulp', url: 'http://gulpjs.com/', target: '_top' }, { label: 'Browsersync', url: 'https://www.browsersync.io/', target: '_top' }, { label: 'GitHub', url: 'https://github.com/', target: '_top' }, { label: 'Shadertoy', url: 'https://www.shadertoy.com/', target: '_top' }, { label: 'jsPerf', url: 'http://jsperf.com/', target: '_top' }, { label: 'Foundation', url: 'http://foundation.zurb.com/', target: '_top' }, { label: 'CreateJS', url: 'http://createjs.com/', target: '_top' }, { label: 'Velocity.js', url: 'http://julian.com/research/velocity/', target: '_top' }, { label: 'jQuery', url: 'https://jquery.com/', target: '_top' }, ];
然后可以通過下面的方法來初始化該3D標(biāo)簽云插件。
$( '#tag-cloud' ).svg3DTagCloud( {entries: entries} );
配置參數(shù)
svg3dtagcloud.js插件的可用配置參數(shù)有:
entries:一個(gè)對(duì)象數(shù)組,用于初始化標(biāo)簽。
width:標(biāo)簽云的寬度。
height:標(biāo)簽云的高度。
radius:標(biāo)簽云的半徑。
radiusMin:標(biāo)簽云的最小半徑。
bgDraw:是否使用背景色。
bgColor:背景顏色。
opacityOver:鼠標(biāo)滑過標(biāo)簽時(shí)的標(biāo)簽透明度。
opacityOut:鼠標(biāo)離開標(biāo)簽時(shí)的標(biāo)簽透明度。
opacitySpeed:標(biāo)簽透明度過渡速度。
fov:how the content is presented。
speed:標(biāo)簽云動(dòng)畫的速度。
fontFamily:標(biāo)簽云的字體。
fontSize:標(biāo)簽云的字體大小。
fontColor:標(biāo)簽云的字體顏色。
fontWeight:標(biāo)簽云的字體的fontWeight。
fontStyle:標(biāo)簽云的字體樣式。
fontStretch:標(biāo)簽云的字體的fontStretch。
fontToUpperCase:是否轉(zhuǎn)換為大寫字體。
以上就是基于HTML5 SVG可互動(dòng)的3D標(biāo)簽云jQuery插件的內(nèi)容,更多相關(guān)內(nèi)容請(qǐng)關(guān)注PHP中文網(wǎng)(m.miracleart.cn)!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to use SVG to achieve image mosaic effect without using Javascript? The following article will give you a detailed understanding, I hope it will be helpful to you!

svg images are widely used in projects. The following article will introduce how to use svg icons in vue3 + vite. I hope it will be helpful to everyone!

svg can be converted to jpg format by using image processing software, using online conversion tools, and using the Python image processing library. Detailed introduction: 1. Image processing software includes Adobe Illustrator, Inkscape and GIMP; 2. Online conversion tools include CloudConvert, Zamzar, Online Convert, etc.; 3. Python image processing library, etc.

With the continuous development of modern Web front-end development, more and more technologies are widely used in actual development. Among them, Vue.js is currently one of the most popular JavaScript frameworks. It is based on the MVVM model and provides a rich API and component library, making it easier to develop responsive, reusable, and efficient web applications. The latest version of Vue.js3 has better performance and richer features than the old version, which has attracted widespread attention and research. This article will introduce to you a

How to add logo to favicon using SVG? The following article will introduce to you how to use SVG to generate favicon with logo. I hope it will be helpful to you!

1. Install vite-plugin-svg-icons. You also need to install fast-glob related dependencies. Otherwise, when vite runs npmrundev, it will report the Cannotfindmodule'fast-glob' error npmifast-glob@3.x-Dnpmivite-plugin-svg. -icons@2.x-D 2. Create a new component index.vueimport{computed}from'vue';cons under src/components/svgIcon

1. Install svg-sprite-loadernpminstallsvg-sprite-loader--save-dev 2. Create a new component under src/components/svgIcon index.vueimport{computed}from"@vue/reactivity";exportdefault{name:"baseSvgIcon", props:{iconClass:{type:String},className:{type:String},},setup

To draw HTMLImageElements on a canvas element, use the drawImage() method. This method defines an Image variable using src="mySVG.svg" and uses drawImage when loading. varmyImg=newImage();myImg.onload=function(){ ctx.drawImage(myImg,0,0);}img.src="http://www.example.com/files/sample.svg";
