스크롤 따라 다니는 레이어 배너 질문드립니다 채택완료
그누보드5 팁자료실에 있는걸 다운받아서 적용해보니
/theme/basic/tail.php 추가
<?php @include_once(G5_PATH.'/banner_fly.php'); ?>
div 가 깨지는데 뭐가 잘못된건지 모르겠습니다
<!--
ver1.0 150421 @_untitle_d
http://untitled.untitle311apyxry1w48.com/5yj67ft">http://untitled.untitle311apyxry1w48.com/5yj67ft
-->
<?php
$tmpWidth = '120';
$tmpMarginBottom = '5';
$tmpBorder = '0';
$arrL = array(
array('http://untitled.untitle311apyxry1w48.com/">http://untitled.untitle311apyxry1w48.com/', 'http://i.imgur.com/SF2cU4h.png">http://i.imgur.com/SF2cU4h.png', 'untitled' ,'_blank'),
array('http://untitled.untitle311apyxry1w48.com/">http://untitled.untitle311apyxry1w48.com/', 'http://i.imgur.com/q92hy6n.png">http://i.imgur.com/q92hy6n.png', 'untitled', '_blank'),
array('http://untitled.untitle311apyxry1w48.com/">http://untitled.untitle311apyxry1w48.com/', 'http://i.imgur.com/sFIVznp.png">http://i.imgur.com/sFIVznp.png', 'untitled', '_blank'),
array('http://untitled.untitle311apyxry1w48.com/">http://untitled.untitle311apyxry1w48.com/', 'http://i.imgur.com/jDmQZaW.png">http://i.imgur.com/jDmQZaW.png', 'untitled', '_blank')
);
$arrR = array(
array('http://untitled.untitle311apyxry1w48.com/">http://untitled.untitle311apyxry1w48.com/', 'http://i.imgur.com/tOLBASU.png">http://i.imgur.com/tOLBASU.png', 'untitled', '_blank'),
array('http://untitled.untitle311apyxry1w48.com/">http://untitled.untitle311apyxry1w48.com/', 'http://i.imgur.com/SF2cU4h.png">http://i.imgur.com/SF2cU4h.png', 'untitled' ,'_blank'),
array('http://untitled.untitle311apyxry1w48.com/">http://untitled.untitle311apyxry1w48.com/', 'http://i.imgur.com/q92hy6n.png">http://i.imgur.com/q92hy6n.png', 'untitled', '_blank'),
array('http://untitled.untitle311apyxry1w48.com/">http://untitled.untitle311apyxry1w48.com/', 'http://i.imgur.com/sFIVznp.png">http://i.imgur.com/sFIVznp.png', 'untitled', '_blank')
);
?>
<script type="text/javascript" src="<?php echo G5_JS_URL ?>/follower.js"></script>
<script type="text/javascript">
//<![CDATA[
$(document).ready(function() {
$('#floatR').scrollFollower({
pageAlign:'center',
pageWidth:980, //컨텐츠 블럭의 폭(필수값)
type:'right',
topMargin:125, //페이지 최상단과의 거리
minTop:80,
margin:5,
speed:500,
easing:'swing',
zindex:10
});
$('#floatL').scrollFollower({
pageAlign:'center',
pageWidth:980,
type:'left',
topMargin:125,
minTop:80,
margin:5,
speed:500,
easing:'linear',
zindex:10
});
});
//]]>
</script>
<div id="floatL">
<?php foreach($arrL as $v){ ?>
<div style="margin-bottom:<?=$tmpMarginBottom?>px">
<a href="<?=$v[0]?>" target="<?=$v[3]?>"><img src="<?=$v[1]?>" width="<?=$tmpWidth?>" border="<?=$tmpBorder?>" alt="<?=$v[2]?>"></a>
</div>
<? } ?>
</div>
<div id="floatR">
<?php foreach($arrR as $v){ ?>
<div style="margin-bottom:<?=$tmpMarginBottom?>px">
<a href="<?=$v[0]?>" target="<?=$v[3]?>"><img src="<?=$v[1]?>" width="<?=$tmpWidth?>" border="<?=$tmpBorder?>" alt="<?=$v[2]?>"></a>
</div>
<? } ?>
</div>
<?php foreach($arrL as $v){ ?> 와 <?php foreach($arrR as $v){ ?> 이함수를 지우면 div가 깨지는건 없는데 스크롤이 안나와서
고수님들 어떻게 해야할지 좀 가르쳐주세요
답변 5개
레이어로 베너를 구현하시는것이라면
CSS만 가지고 처리가 됩니다.
샘플 : http://gboard.deb.kr/test/scrollBanner.php">http://gboard.deb.kr/test/scrollBanner.php
</p><p><style></p><p><span style="font-size: 11pt;">.fix {position:fixed;top:20%;right:10%;width:50px;height:300px;background-color:#ccc;border:1px solid #333;}</span> </p><p>.fix2 {position:fixed;top:10px;right:200px;width:500px;height:100px;background-color:#EEE;border:1px solid #33A;}</p><p></style><span style="white-space:pre"> </span></p><p> </head></p><p> <body ></p><p><span style="font-size: 11pt; white-space: pre;"> </span><span style="font-size: 11pt;"><div class="fix"> 베너를 여기다가 만들면 브라우저에 비율로 고정됩니다., 상하를 줄여보세요 </div></span> </p><p> <span style="white-space:pre"> </span><div class="fix2"> 베너를 여기다가 만들면 브라우저 상단에 붙게 고정됩니다. </div></p><div>
답변에 대한 댓글 1개
댓글을 작성하려면 로그인이 필요합니다.
저처럼 찾아보시다가 헤매시는 분 계실까봐 남겨드릴게요
추가 했는데 자꾸 레이아웃이 박살나서 나오더라구요
</p>
<p><div id="floatL">
<?php foreach($arrL as $v){ ?>
<div style="margin-bottom:<?=$tmpMarginBottom?>px">
<a href="<?=$v[0]?>" target="<?=$v[3]?>"><img src="<?=$v[1]?>" width="<?=$tmpWidth?>" border="<?=$tmpBorder?>" alt="<?=$v[2]?>"></a>
</div>
<? } ?> << 이부분에서 php 가 빠져서 <?php } ?> 로 변경해주세요
</div></p>
<p>
<div id="floatR">
<?php foreach($arrR as $v){ ?>
<div style="margin-bottom:<?=$tmpMarginBottom?>px">
<a href="<?=$v[0]?>" target="<?=$v[3]?>"><img src="<?=$v[1]?>" width="<?=$tmpWidth?>" border="<?=$tmpBorder?>" alt="<?=$v[2]?>"></a>
</div>
<? } ?> << 이부분에서 php 가 빠져서 <?php } ?> 로 변경해주세요
</div></p>
<p>
저는 <? } ?> 라고 된 부분을 <?php } ?> 로 수정해서 해결 했습니다
댓글을 작성하려면 로그인이 필요합니다.
@Darcy
님
스크롤이 없다고 하신건..
화면에서 실제로 스크롤할 만큼 사이즈가 준비되지 않은게 아닐까요?
위에서 언급하신
<?php foreach($arrL as $v){ ?> 와 <?php foreach($arrR as $v){ ?> 이함수를 지우면 div가 깨지는건 없는데 스크롤이 안나와서
는 함수가 아니라.
php구문중에서
배열변수를 분리해서 URL / image를 보기 위한
반복문입니다.
안보이신다고 한 URL을 보여주시면 확인해볼수있지 않을까 싶네요
댓글을 작성하려면 로그인이 필요합니다.
@Darcy
님
제 사이트 샘플 페이지 다시보세요
http://gboard.deb.kr/test/scrollBanner.php">http://gboard.deb.kr/test/scrollBanner.php
보시면 말씀하신 기능 작동되고,
해당 소스는 소스보기해서 퍼가세요
답변에 대한 댓글 1개
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인