JQuery + CSS: how to place buttons on images _ jquery-js tutorial

Source: Internet
Author: User
This article mainly introduces how to place buttons on Images Using JQuery + CSS, involving jQuery mouse events and page styles, for more information about how to use JQuery and CSS to place buttons on images, see the following example. Share it with you for your reference. The specific analysis is as follows:

Position: relative is generally set to the parent layer of position: absolute; in daily applications,
Parent layer position: relative; Sub-layer position: absolute; is located according to the parent layer boundary,
Otherwise, position: absolute searches for the element boundary of position: relative layer by layer until the body element ..

Method 1 (append together with CSS)

Var freeOne = ""; freeOne = $ (". freePreviewOne "). attr ("data-url"); if (freeOne = null) {// No free video} else {$ ("# coursePicture "). append ("" + "try ");}

Page:

<#if course.coverImage?has_content> <#else>

Method 2:

// Place a button on the course image /*Bytes* // $ ("# CoursePicture "). append ("principal"); var freeOne = ""; freeOne = $ (". freePreviewOne "). attr ("data-url"); if (freeOne = null) {// No free video} else {$ ("# coursePicture "). append ("" + "try ");}

Page:

 

<#if course.coverImage?has_content> <#else>

Run the following command:

I hope this article will help you with jQuery programming.

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.