티스토리 뷰

// CSS
/* DIV SIDE BANNER 시작 */
#divLeftBanner{left:50%; width:100px; margin-left:-610px; z-index:9999px;}
#divRightBanner{right:50%; width:100px; margin-right:-610px; z-index:9999px;}
/* DIV SIDE BANNER 시작 */


==========================================================================================
// SCRIPT
$(document).ready(function () {
   $(window).scroll(function () {
      var positionTop = 0;
      var scrollHeight = $(window).scrollTop();
      //alert("scrollHeight : "+ scrollHeight);  // 2583
      //var windowHeight =  $(window).height();
      //alert("windowHeight : "+ windowHeight);  // 909
      //var documentHeight = $(document).height();
      //alert("documentHeight : "+ documentHeight);  // 3492
      
      if( scrollHeight  >= 230 ) {
         //alert("1");
         //alert("window.height : "+ scrollHeight + " window.scrollTop : " + windowHeight + " / documentHeight : "+documentHeight);
         //alert( $("#divRightBanner").position().top );

         $("#divLeftBanner").css('position','fixed').css('top','10px');
         $("#divRightBanner").css('position','fixed').css('top','10px');
      } else {
         //alert("2");
         positionTop = 230 - scrollHeight;
         if( scrollHeight  == 0 ) {
            $("#divLeftBanner").css('position','fixed').css('top','230px');
            $("#divRightBanner").css('position','fixed').css('top','230px');
         } else {
            $("#divLeftBanner").css('position','fixed').css('top',positionTop+'px');
            $("#divRightBanner").css('position','fixed').css('top',positionTop+'px');
         }
      }
   });
});


==========================================================================================
// HTML
< div id="divRightBanner" align="left" style=" position:fixed; top:230px; width:100px; border:0px solid #DDD;">
< img src="/img/pages/imgRightBanner.jpg" width="100" />
< SCRIPT language="JavaScript">
function pageChangeRightHandler(strMid) { 
   document.location.href='/pages/business/?txtMid='+strMid; 
}
< /SCRIPT>
< ?
// 이미지 정보
$query = "SELECT * FROM BANNER WHERE GUBUN = '2' ORDER BY RANK ASC ";
$result = mysql_query($query);
$rowNum = mysql_affected_rows();
for($i = 0; $i < $rowNum; $i++) {
   $row = mysql_fetch_array($result);

   if($row[FILENAME]!="") {
      $row[FILENAME] = fileViewHandler($row[FILENAME]); // miniHandler
      if($row[LINK]!="") {
         echo "<img src='/CMS/banner/img/".$row[FILENAME]."' style='border:1px solid #DDD; cursor:pointer;' onClick='pageChangeRightHandler("".$row[LINK]."")'/><br />";
      } else {
         echo "<img src='/CMS/banner/img/".$row[FILENAME]."' style='border:1px solid #DDD;'/><br />";
      }
   }
}
?>
< table width="100" border="0" cellpadding="0" cellspacing="0" style="border:1px solid #ddd; margin:5px 0px;"><tr><td align="center" style="font-weight:bold; padding:3px;">
< a href="#">TOP</a>
< /td></tr></table>
< /div> 

Total
Today
Yesterday
최근에 올라온 글
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31