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.