--- tags: jQuery --- <style> .blue { color: blue; margin: 130px 0; display: block; } </style> <h1>複製圖片, 到另外的區域</h1> ### 程式碼 ```python=1 if ($('判斷某class 是否存在').length > 0) { var imgURL = $('被抓取區域的class').find('img').attr('src'); $('引用到某個區域 class ').css('background-image', 'url(' + imgURL + ')'); } ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up