Giter Site home page Giter Site logo

dirslide's Introduction

dirSlide

可以跟踪鼠标移动方向的滑动插件 ###说明 1.应用对象ul,id必须是dirList
2.此版本是beta版本,可能存在Bug;
3.仅用于交流和学习,不作商业用途。
4.与我联系:淡忘~浅思 久艾分享 欢迎交流
5.相关文章:JS判断鼠标进入容器的方向

###使用说明 #####如何使用 依赖于JQuery,所以要先引入JQuery,一个简单示例:

<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>dirSlide</title>

<script src='http://libs.baidu.com/jquery/1.9.0/jquery.js'></script>
</head>
<body>

    <ul id='dirList'>
        <li><img src='1.jpg'/><div>图片一</div></li>
        <li><img src='2.jpg'/><div>图片二</div></li>
        <li><img src='3.jpg'/><div>图片三</div></li>
        <li><img src='4.jpg'/><div>图片四</div></li>
        <li><img src='5.jpg'/><div>图片五</div></li>
    </ul>
      <h3 style="text-align:center">交流:<a href="http://www.ido321.com" target="_blank">dwqs</a></h3>

<script type="text/javascript" src="./dirSlide.min.js"></script>
<script>
    $("#dirList").dirSlide();
</script>
</body>
</html>

效果请戳:Demo

#####一些参数 可以给dirSlide()传入一个对象参数,参数列表如下:

参数 说明 默认值
wrapbg 设置#dirList的背景色 null
lisdis 设置#dirList的子元素li之间的margin,设置时不需要带单位 10
width li元素的宽度,设置时不需要带单位 null
height li元素的高度,设置时不需要带单位 null
fontname 遮罩的字体名 Microsoft Yahei
opacity 遮罩的透明度 0.7
lisbg 遮罩的背景色 #0C0E0C
fontsize 遮罩的字体大小,设置时不需要带单位 25
color 遮罩的字体颜色 #FFF
anitime 遮罩动画变化时间 200
outtime setTimeout的间隔时间 200

修改默认的参数

<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>dirSlide2</title>

<script src='http://libs.baidu.com/jquery/1.9.0/jquery.js'></script>
</head>
<body>

    <ul id='dirList'>
        <li><img src='1.jpg'/><div>图片一</div></li>
        <li><img src='2.jpg'/><div>图片二</div></li>
        <li><img src='3.jpg'/><div>图片三</div></li>
        <li><img src='4.jpg'/><div>图片四</div></li>
        <li><img src='5.jpg'/><div>图片五</div></li>
    </ul>
      <h3 style="text-align:center">交流:<a href="http://www.ido321.com" target="_blank">dwqs</a></h3>

<script type="text/javascript" src="./dirSlide.min.js"></script>
<script>
    $("#dirList").dirSlide({
    	lisbg:"#AD087C",
        color:"#000",
        anitime:"1000",
        opacity:"0.5",
        wrapbg:"#CCC"
    });
</script>
</body>
</html>

演示地址:http://test92.sinaapp.com/dirSlide/dirSlide2.html

dirslide's People

Contributors

dwqs avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.