HTML5 and CSS3 instance tutorial Summary (recommended), html5css3

Source: Internet
Author: User

HTML5 and CSS3 instance tutorial Summary (recommended), html5css3

Onclick behavior and content Separation

1. trigger a pop-up window via Link (this method is not recommended !!!)

Copy XML/HTML Code to clipboard
  1. <A href = '#'
  2. Onclcik = "too many open('holiday_pay.html ', WinName, 'width = 300, height = 300');">
  3. Holiday Pay
  4. </A>

If the JS disabled link cannot direct the user to the corresponding page, do not assign "#" and similar values to the href attribute.

2. General situation

Copy XML/HTML Code to clipboard
  1. <A hrefpolic'holiday_pay.html'
  2. Onclcik = "window. open (this. href, WinName, 'width = 300, height = 300 ');">
  3. Holiday Pay
  4. </A>

3.0 a large number of duplicate links are allocated with recognizable class names for each link. You can add listeners for each click event by using jQuery.

Copy XML/HTML Code to clipboard
  1. <A href = "holiday_pay" class = "popup"> Holiday pay </a>
  2. Var links = $ ("a. popup ");
  3. Links. clcik (function (event ){
  4. Event. preventDefault ();
  5. Window. open ($ (this). attr ('href '));
  6. });

3.1 Multi-User custom data type setting window size in the pop-up window

Copy XML/HTML Code to clipboard
  1. <A href = "holiday_pay.html"
  2. Data-width = "600"
  3. Data-heigth = "400"
  4. Title = "Holiday Pay"
  5. Class = "popup"> Holiday pay </a>
Copy the content to the clipboard using JavaScript Code
  1. $ (Function (){
  2. $ (". Popup"). click (function (event ){
  3. Event. preventDefault ();
  4. Var href = $ (this). attr ("href ");
  5. Var width = $ (this). attr ("data-width ");
  6. Var height = $ (this). attr ("data-height ");
  7. Var popup = window. open (href, "popup", "height =" + height + ", width =" + width + "");
  8. });
  9. });

The above HTML5 and CSS3 instance tutorial Summary (recommended) is all the content shared by xiaobian. I hope to give you a reference, and I hope you can provide more support for helping customers.

Address: http://www.cnblogs.com/liul0703/p/5677644.html

Related Article

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.