웹마스터 팁

아래 166번 글을 보시면 Legend님이 올려 주신거와 똑 같죠.
근데.. 이건 예전에 어디선가 소스 복사해서 컴에 보관했었는데...
Legend님이 올려주신거 보고 생각이 나서 내가 만든건 아니지만 올려봅니다.

혹시나 이 스크립트를 만든 사람이 본인이라면.. 쪽지나 코멘트 주세요.
저작권 넣겠습니다.

음.. 이걸 다른데.. 응용해도 되구요.
일단은 배너 소스 카피를 하는 예로 들어보겠습니다.

배너가 하나가 아닌 여러개 일 경우 이렇게 하면 되겠죠.
미리보기를 먼저 보시면 이해가 빠를겁니다.

미리보기 : http://oxtag.com/html/ex/banner.html

그리고. 자세한 설명은 166번 글을 참조하세요.

<script>
function copy_select(s){
    var doc = document.body.createTextRange();
    doc.moveToElementText(document.all(s));
    doc.select();
    doc.execCommand('copy');
    alert('배너 소스가 클립보드로 카피되었습니다. ^^;nnCtrl + V로 문서에 바로 붙여넣기 하시면 됨니다.');
}
</script>

<a href="javascript:copy_select('banner1')" onfocus=this.blur()><img src="./../img/banner.gif" border=0></a>
<a href="javascript:copy_select('banner2')" onfocus=this.blur()><img src="./../img/flag1.gif" border=0></a>
<a href="javascript:copy_select('banner3')" onfocus=this.blur()><img src="./../img/banner4.gif" border=0></a>

<div id=banner1 style=visibility:hidden;>&lt;a href=http://oxtag.com target=_blank onfocus=this.blur()>&lt;img src=http://oxtag.com/html/img/banner.gif border=0>&lt;/a></div>
<div id=banner2 style=visibility:hidden;>&lt;a href=http://oxtag.com target=_blank onfocus=this.blur()>&lt;img src=http://oxtag.com/html/img/flag1.gif border=0>&lt;/a></div>
<div id=banner3 style=visibility:hidden;>&lt;a href=http://oxtag.com target=_blank onfocus=this.blur()>&lt;img src=http://oxtag.com/html/img/banner4.gif border=0>&lt;/a></div>

대충 이해가 가시죠.
여기서 링크 부분과 div 부분의 id는 서로서로 일치를 해야겠죠.
그리고 visibility:hidden;은 화면상에 보이지 않게 감추는 거구요.

주의할 점은 감추는 부분의 div내의 복사할 주소의 시작 태그인 < 이걸 &lt; 이걸로 해주셔야겠죠.