1. Mobile-side JS Event
The mobile side of the operation and the PC side is different, mobile is mainly operated by the finger, so there is a special touch event, the touch event includes the following several events:
1, Touchstart://trigger when the finger is placed on the screen
2, Touchmove://finger on the screen sliding trigger
3, Touchend://trigger when the finger leaves the screen
4, Touchcancel://The system cancels the touch event when triggered, relatively less use
Mobile side generally have three kinds of operation, click, Slide, drag, these three kinds of operations are generally combined using the above several events to complete, all the above 4 events are rarely used alone, is generally used to implement the package of three operations, you can use the package of mature JS library.
2. Zeptojs
Zepto is a lightweight JavaScript library for modern advanced browsers, which has a similar API to jquery. If you can use jquery, you'll also use Zepto. Some of the optional features of Zepto are specifically for mobile browsers; its initial goal is to provide a streamlined JS library like jquery on the mobile side.
Zepto Official website: http://zeptojs.com/
Zepto Chinese api:http://www.css88.com/doc/zeptojs_api/
Zepto contains a number of modules, the default download version contains the module has core, Ajax, Event, Form, ie module, if you need other modules, you can customize the build.
Zepto Custom Build Address: http://github.e-sites.nl/zeptobuilder/
The touch module encapsulates the events commonly used for mobile, which can be developed using this module for mobile-specific effects such as:
- Tap element is triggered when tap, this event is similar to click, but faster than click.
- Longtap when an element is pressed more than 750ms trigger.
- Swipe, Swipeleft, Swiperight, Swipeup, Swipedown when the element is crossed out triggers. (You can select a given direction)
3. Swiper
Swiper.js is a mature and stable application to the PC and mobile end of the sliding effect plug-in, generally used to touch the focus of the screen, touch screen scrolling and other effects. Swiper is divided into 2.x version and 3.x version, 2.x version supports low version browser (IE7), 3.x discard support low version browser, suitable for application on mobile side.
Version 2.x Chinese address: http://2.swiper.com.cn/
3.x version Chinese network address: http://www.swiper.com.cn/
Swiper How to use:
<script type="Text/javascript"Src="Js/swiper.min.js"></script>......<link rel="stylesheet"Type="Text/css"href="Css/swiper.min.css">......<divclass="Swiper-container"> <divclass="Swiper-wrapper"> <divclass="Swiper-slide">slider1</div> <divclass="Swiper-slide">slider2</div> <divclass="Swiper-slide">slider3</div> </div> <divclass="swiper-pagination"></div> <divclass="Swiper-button-prev"></div> <divclass="Swiper-button-next"></div></div><script>var swiper= New Swiper ('. Swiper-container', {pagination:'. Swiper-pagination', Prevbutton:'. Swiper-button-prev', Nextbutton:'. Swiper-button-next', Initialslide:1, Paginationclickable:true, Loop:true, AutoPlay:3000, Autoplaydisableoninteraction:false});</script>
Swiper Using Parameters:
1, initialslide: Initial index value, starting from 0
2, direction: Sliding direction Horizontal | Vertical
3, Speed: sliding velocity, Unit ms
4. AutoPlay: Set auto play and play time
5, Autoplaydisableoninteraction: Whether the user operates swipe after the automatic playback, the default is true, no longer automatically play
6, pagination: Pagination dot
7, Paginationclickable: Whether the paging dot click
8. Prevbutton: Prev Arrow
9, Nextbutton: Next page Arrow
10, Loop: Whether the end-to-end connection
11. Onslidechangeend: Callback function, execution at end of swipe
Swiper Production Example:
1, Swiper production mobile Focus Map instances
2, Swiper make full page scrolling effect
4.bootstrap
A simple, intuitive, and powerful front-end development framework that makes web development faster and easier. From Twitter, is one of the most Popular front-end frameworks available. Bootrstrap is based on HTML, CSS, and JavaScript, making it easier to write code. Mobile-First, responsive layout development.
Bootstrap Chinese website: http://www.bootcss.com/
Bootstrap container
- Container-fluid Fluid
- Container
Bootstrap grid system
Bootstrap divides the page horizontally into 12 equal parts, and defines a style class that adapts to different widths according to the 12 divide, which forms a set of responsive, mobile-first-class streaming raster systems:
1, col-lg-
2, col-md-
3, col-sm-
4, col-xs-
Bootstrap-Response query interval:
1, greater than or equal to 768
2, greater than or equal to 992
3, greater than or equal to 1200
Bootstrap form
1. form declares a form field
2. form-inline Inline form Field
3. Form-horizontal Horizontal arrangement of form fields
4. Form-group form groups, including form text and form controls
5. Form-control text input box, drop-down list control style
6. CheckBox Checkbox-inline Multi-marquee style
7. Radio Radio-inline Single Box style
8. Input-group Form Control Group
9. Input-group-addon Form control group Object style 10, INPUT-GROUP-BTN form control group object is the style of the button
10. FORM-GROUP-LG Large Size form
11, form-group-sm small size form
Bootstrap button
1. BTN Declaration button
2. Btn-default Default button style
3, Btn-primay
4, Btn-success
5, Btn-info
6, Btn-warning
7, Btn-danger
8, Btn-link
9, BTN-LG
10, BTN-MD
11, Btn-xs
12, Btn-block width is the parent width 100% button
13. Active
14, disabled
15. Btn-group Define button Group
Bootstrap pictures
Img-responsive declaring a responsive picture
Bootstrap Hidden Classes
1, Hidden-xs
2, HIDDEN-SM
3, HIDDEN-MD
4, HIDDEN-LG
Bootstrap font icon
The font folder needs to be in the same directory as the CSS folder by using fonts instead of icons
Bootstrap drop-down menu
1, Dropdown-toggle
2, Dropdown-menu
Bootstrap tab
1. Nav
2, Nav-tabs
3, Nav-pills
4, Tab-content
Bootstrap navigation bar
1. NavBar Declaration navigation Bar
2. Navbar-default declares the default navigation bar style
3. Navbar-inverse Declaration anti-white navigation bar style
4, navbar-static-top Remove the rounded corners of the navigation bar
5, Navbar-fixed-top fixed to the top of the navigation bar
6, Navbar-fixed-bottom fixed to the bottom of the navigation bar
7, Navbar-header declare the logo of the container
8, Navbar-brand for the logo and other fixed content style
11. Nav Navbar-nav define the menu in the navigation bar
12. Navbar-form define the form in the navigation bar
13. Navbar-btn define the buttons in the navigation bar
14. Navbar-text defines the text in the navigation bar
9. Navbar-left menu on left
10. Navbar-right menu on the right
Bootstrap modal frame
1. Modal Declare a modal frame
2, Modal-dialog define the modal frame size
3, MODAL-LG definition of large-size modal frame
4, MODAL-SM define the small size modal frame
5, Modal-header
6, Modal-body
7, Modal-footer
Bootstrap Responsive Thematic site examples
Mobile End Library