Category: Javascript /Jquery / React / Bootstrap / Web

纯CSS实现帅气的SVG路径描边动画效果

一、应该人人皆会的基础技术 简而言之,就是让SVG的描边像是有人绘制一样的动画效果。 国外很多相关介绍的文章,来看看一些效果gif吧~ 我至少看到了4篇外文对此技术介绍(参见文末参考文章),觉得挺有意思,也很好入门,可以不依赖JavaScript,故移花接木,借花献佛,以自己的理解给大家介绍下。 二、效果先行,兴趣挑起 您可以狠狠地点击这里:帅气的签名动画demo 三、你需要知道的基础知识 SVG中有个比较重要的属性分支,名为stroke, 中文软件中称之为“描边”。 stroke除了自己,还有其他诸多兄弟姐妹,来,站起来给大家瞅瞅: stroke 表示描边颜色。这很有意思,名字不是stroke-color, 而就是… Read More

SVG矢量绘图 path路径详解(贝塞尔曲线, 曲线, 平滑直线及弧形)

path元素的形状是通过属性d定义的,属性d的值是一个“命令+参数”的序列,我们将讲解这些可用的命令,并且展示一些示例。 每一个命令都用一个关键字母来表示,比如,字母“M”表示的是“Move to”命令,当解析器读到这个命令时,它就知道你是打算移动到某个点。跟在命令字母后面的,是你需要移动到的那个点的x和y轴坐标。比如移动到 (10,10)这个点的命令,应该写成“M 10 10”。这一段字符结束后,解析器就会去读下一段命令。每一个命令都有两种表示方式,一种是用大写字母,表示采用绝对定位。另一种是用小写字母,表示采用相对定位(例如:从上一个点开始,向上移动10px,向左移动7px)。 因为属性d采用的是用户… Read More

SVG矢量绘图 path路径详解(基本画法)

SVG的形状标签里,path是最强大的一个,掌握了path就足够处理常见的绘图问题了。 先看一下path标签的基本用法: <path d=”M100,100 L200,200 L200,400″ fill=”#333″ stroke=”#000″ /> path标签通过属性d来定义路径,定义信息由一段字符串构成,另外path也可以通过fill和stroke属性来定义填充和边框。 d属性的信息其实并不复杂,由字母和数字构成,数字表示坐标点,字母负责表示如何连接这些坐标点。比如上面的示例中,M表示起点,L表示直线连接,所以d的信息可以… Read More

jquery:颜色拾取器 Tiny Colorpicker

What is it? Tiny Colorpicker is a crossbrowser jquery plugin that creates a color picker (form) input. Its a easy way to add color pickers to your forms or user interface. Features IOS and Android support. AMD, Node, requirejs and commonjs support. Easy customizable Can be used inside forms or outside Lightweight Source is on GitHub 用法: $(document).ready(… Read More

jquery:圆形slider show – Tiny Circleslider – A lightweight cross browser circular carousel

What is it? Tinycircleslider is a circular slider / carousel. That was built to provide webdevelopers with a cool but subtle alternative to all those standard carousels. Tiny Circleslider can blend in on any wepage. It was built using the javascript jQuery library. Features IOS and Android support. AMD, Node, requirejs and commonjs support. Supports sli… Read More

jquery: 手机版时间拾取器 date time picker for mobile

Pickers There are three picker files: picker.js The core file (required before any other picker) picker.date.js The date picker picker.time.js The time picker To support old browsers, namely IE8, also include the legacy.js file. Themes All themes are generated using LESS and compiled from the lib/themes-source folder into the lib/themes folder. Ther… Read More

Take a Photo and Upload it on Mobile Phones with HTML5

In my daily life, I enjoy taking photos with my smartphone and uploading them to various websites. So I started thinking, “Is it possible to implement these functions in web browser?” Although Dynamsoft ImageCapture Suite allows us to capture images from webcam, it is designed for a desktop App development on windows and Mac, not

使用FormData对象

利用FormData对象,你可以使用一系列的键值对来模拟一个完整的表单,然后使用XMLHttpRequest发送这个”表单”. 创建一个FormData对象 你可以先创建一个空的FormData对象,然后使用append()方法向该对象里添加字段,如下: var oMyForm = new FormData(); oMyForm.append("username", "Groucho"); oMyForm.append("accountnum", 123456); // 数字123456被立即转换成字符串"123456" // fileInputElement中已经包含了用户所选择的文件 oMyFor… Read More

PHP / JavaScript countries array, US states array

For those who just wanted those arrays done quick and easy, here is it, in raw php $countries = array( "AF" => "Afghanistan", "AL" => "Albania", "DZ" => "Algeria", "AS" => "American Samoa", "AD" => "Andorra", "AO" => "Angola", "AI" => "Anguilla", "AQ" => "Antarctica", "AG" => "Antigua and Barbuda", "AR" => "Argentina", "A… Read More

GMaps.js:让你快速集成 Google Maps 服务的 jQuery 插件

GMaps.js 功能 除了添加指定经纬度的标准地图之外,GMaps.js 还能定义地图放大的级别,添加标注,获取当前用户的地理位置(HTML5 geolocation),定义路线,绘制折线,并且实现这些功能只需要简单的几行代码。 另外 GMaps.js 每个动作都有 callback 函数让你去集成自定义事件。目前 GMaps.js 没有详细的文档,但是每个功能都有具体的例子,参考下基本就可以使用了。   DEMO: http://hpneo.github.io/gmaps/examples.html 官网:http://hpneo.github.io/gmaps/ 文档:http://hpneo.github.… Read More

Google Maps API v3: Remove Markers 移除标记

Simply do the following: I. Declare a global variable: var markersArray = ; II. Define a function: function clearOverlays() { for (var i = 0; i < markersArray.length; i++ ) { markersArray[i].setMap(null); } markersArray.length = 0; } OR google.maps.Map.prototype.clearOverlays = function() { for (var i = 0; i < markersArray.length; i++ ) {