상단의 png 파일에 링크를 걸었는데요.
오류가 나는곳의 주소를 알려주시면 더 빠르고 정확하게 답변 받을 수 있습니다.
오류 주소 : http://sooram.dnip.net:8087/
위의 주소에서 상단의 "Home | Login | Mypage ~" 등에 링크를 걸었습니다.
png 파일이고요.
http://blog.naver.com/kimkaprio?Redirect=Log&logNo=20018663577
위 주소대로 png 파일에 투명을 줬어요.
그런데 문제는 링크를 거니깐 배경이 하얗게되네요.
한번 클릭 한 후에는 계속 투명이되고요.
왜 그럴까요? 해결방법 없나요?
오류 주소 : http://sooram.dnip.net:8087/
위의 주소에서 상단의 "Home | Login | Mypage ~" 등에 링크를 걸었습니다.
png 파일이고요.
http://blog.naver.com/kimkaprio?Redirect=Log&logNo=20018663577
위 주소대로 png 파일에 투명을 줬어요.
그런데 문제는 링크를 거니깐 배경이 하얗게되네요.
한번 클릭 한 후에는 계속 투명이되고요.
왜 그럴까요? 해결방법 없나요?
|
댓글을 작성하시려면 로그인이 필요합니다.
댓글 9개
png 가 최근에 나온 형식으로 24bit 에서 투명처리를 할 수 있지만
아직 인터넷 브라우저에서는 png 를 기본지원 하지 않습니다.
위 파일을 투명하게 저장하는 방법은 gif로 저장을 하셔야 합니다.
플래시에서 모드를 transparent로 하시면 깨끗하게 이미지 위에 올릴 수 있습니다.
모션도 약간 주면 더 좋죠
우선 1x1px 짜리 투명 이미지를 만들어 blank.gif 로 저장합니다.
<public:component>
<public:attach event="onpropertychange" onevent="doFix()" />
<script type="text/javascript">
// IE5.5+ PNG Alpha Fix v1.0RC4
// (c) 2004-2005 Angus Turnbull http://www.twinhelix.com
// This is licensed under the CC-GNU LGPL, version 2.1 or later.
// For details, see: http://creativecommons.org/licenses/LGPL/2.1/
// This must be a path to a blank image. That's all the configuration you need.
if (typeof blankImg == 'undefined') var blankImg = '/img/blank.gif'; // 1x1px 짜리 투명 이미지 경로를
var f = 'DXImageTransform.Microsoft.AlphaImageLoader';
function filt(s, m)
{
if (filters[f])
{
filters[f].enabled = s ? true : false;
if (s) with (filters[f]) { src = s; sizingMethod = m }
}
else if (s) style.filter = 'progid:'+f+'(src="'+s+'",sizingMethod="'+m+'")';
}
function doFix()
{
// Assume IE7 is OK.
if (!/MSIE (5\.5|6\.)/.test(navigator.userAgent) ||
(event && !/(background|src)/.test(event.propertyName))) return;
var bgImg = currentStyle.backgroundImage || style.backgroundImage;
if (tagName == 'IMG')
{
if ((/\.png$/i).test(src))
{
if (currentStyle.width == 'auto' && currentStyle.height == 'auto')
style.width = offsetWidth + 'px';
filt(src, 'image');
// 'scale' 을 'image' 으로 변경하면 padding 적용시 나타나는 이미지 크기의 변화(잘못된 렌더링)를 방지할 수 있다. 하지만 border 표현에 문제가 생긴다.
src = blankImg;
}
else if (src.indexOf(blankImg) < 0) filt();
}
else if (bgImg && bgImg != 'none')
{
if (bgImg.match(/^url[("']+(.*\.png)[)"']+$/i))
{
var s = RegExp.$1;
if (currentStyle.width == 'auto' && currentStyle.height == 'auto')
style.width = offsetWidth + 'px';
style.backgroundImage = 'none';
filt(s, 'crop');
// IE link fix.
for (var n = 0; n < childNodes.length; n++)
if (childNodes[n].style) childNodes[n].style.position = 'relative';
}
else filt();
}
}
doFix();
</script>
</public:component>
위 소스를 복사해서 파일 확장자랑 이름을 iepngfix.htc 로 저장.
투명이미지를 쓰는 페이지의 css 화일에 .iePngFix {behaviorurl(iepngfix.htc);} 추가.
아, 다음번 홈페이지 만들 때 써먹도록 할께요..감사합니다.