HTML5 and CSS3 instance tutorial [Summary 1], html5css3

Source: Internet
Author: User

HTML5 and CSS3 instance tutorial [Summary 1], html5css3

Onclick behavior and content Separation

<a href='#'     onclcik = "window.open('holiday_pay.html',WinName,'width=300, height = 300');">Holiday Pay </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

<a href='holiday_pay.html'     onclcik = "window.open(this.href,WinName,'width=300, height = 300');">Holiday Pay </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.

<a href="holiday_pay" class="popup">Holiday pay</a>
var links = $("a.popup");links.clcik(function(event){   event.preventDefault();   window.open($(this).attr('href'));   });

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

<a href ="holiday_pay.html"    data-width="600"    data-heigth = "400"    title = "Holiday Pay"    class = "popup"> Holiday pay </a> 
$(function(){   $(".popup").click(function(event){       event.preventDefault();       var href=$(this).attr("href");       var width = $(this).attr("data-width");       var height = $(this).attr("data-height");       var popup = window.open(href,"popup","height="+height+",width="+width+"");}) ;});

 

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.