8. Create a webpage Dreamweaver (jQuery basics: Installation and syntax) and dreamweaverjquery

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.