8. Create a webpage Dreamweaver (jQuery basics: Installation and syntax) and dreamweaverjquery
Using jQuery Technology in "webpage making Dreamweaver (floating dynamic hierarchical navigation)", you can easily implement drop-down, display, and hide menu effects without having to modify the style sheet a little bit, this saves a lot of trouble, so how to use jQuery is detailed in the following sections:
1. installation:
Http://jquery.com/download/log on to the jquerydownload site, which has the following features:
General developers can choose to download (1). The file is small and enough. Of course, jQuery needs to be developed for downloading (2)
After the download is complete, enter dwx and import it in the
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
(HTML5 does not need to write type = "text/javascript ")
------------------------------
2. syntax and selector:
$ (Selector). action ()
- Dollar sign defines jQuery
- Selector: "query" and "Search" HTML elements -- selector
- JQuery action () executes operations on elements -- events
Selector usage:
Syntax |
Description |
$ (This) |
Current HTML Element |
$ ("P ") |
All <p> Elements |
$ ("P. intro ") |
All <p> elements of class = "intro" |
$ (". Intro ") |
All class = "intro" Elements |
$ ("# Intro ") |
Id = "intro" element |
$ ("Ul li: first ") |
The first <li> element of each <ul> |
$ ("Your href00000000'.jpg ']") |
All href attributes with attribute values ending with ". jpg" |
$ ("Div # intro. head ") |
All the elements of class = "head" in the <div> element of id = "intro" |
The above is the basic call of jQuery. For the trigger event, see: 9. Create a webpage Dreamweaver (jQuery basics: events)