I have an issue i couldn't figure out so far. I googled and searched here, found some answers, but I can't get it to work.現在の背景画像へのURLを取得し、<a href>
I want to figure out the current background image from css and create a link to download the image.
This is my simplyfied code so far:
<style type="text/css">
body.custom-background { background-image: url('http://localhost:8888/wp-content/uploads/2012/04/bg2.jpg'); background-repeat: no-repeat; background-position: top center; background-attachment: scroll; }
</style>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
var image = body.custom-background.css('background-image').replace(/^url\((.*?)\)$/, '$1');
document.getElementById('link').setAttribute("href",image);
</script>
<div id="hide">
<a id="hidepage">hide page</a>
<a id="showpage" style="display:none;">show page</a>
</div>
<div id="downloadbg">
<a id="link"><br>Download Background</a>
</div>
I am pretty new to programming and I am running out of ideas.
Thank you very much for your help.
は次のようになり? – Jrod