رفتن به مطلب

اسکرول دار کردن یک ستون


پست های پیشنهاد شده

سلام دوستان ... بنده تو سایتم 4 تا ستون کنار هم دارم ... حالا میخام کاری کنم که هر کدوم از این ستون های یه اسکرول داشته باشه تا بشه اخبار بیشتری رو توش ببینم

کد :


<div class="bottom"><!--start---->
<div class="bt">
<div class="video">سیاسی</div>
</div><br><br>
<?php $recent = new WP_Query("cat=26&showposts=5"); while($recent->have_posts()) : $recent->the_post();?>
<div class="t1">

<a href="<?php the_permalink() ?>" rel="bookmark"></a>
<a href="<?php the_permalink() ?>">
<div class="t1thumb">
<?php the_post_thumbnail( array(0,0) ); ?>
</a>
</div>
</div>
<div class="t2">
<a href="<?php the_permalink() ?>" rel="bookmark"></a>
<a href="<?php the_permalink() ?>">
<h3><?php the_title(); ?></h3>
</a><br>
</div>

<?php endwhile; ?>


</div><!--End---->
<div class="bottom"><!--start---->
<div class="bt">
<div class="image">فرهنگی</div>
</div><br><br>
<?php $recent = new WP_Query("cat=3774&showposts=5"); while($recent->have_posts()) : $recent->the_post();?>
<div class="t1">

<a href="<?php the_permalink() ?>" rel="bookmark"></a>
<a href="<?php the_permalink() ?>">
<div class="t1thumb">
<?php the_post_thumbnail( array(0,0) ); ?>
</a>
</div>
</div>
<div class="t2">
<a href="<?php the_permalink() ?>" rel="bookmark"></a>
<a href="<?php the_permalink() ?>">
<h3><?php the_title(); ?></h3>
</a><br>
</div>

<?php endwhile; ?>


</div><!--End---->
<div class="bottom"><!--start---->
<div class="bt">
<div class="article">ورزشی</div>
</div><br><br>
<?php $recent = new WP_Query("cat=27&showposts=5"); while($recent->have_posts()) : $recent->the_post();?>
<div class="t1">

<a href="<?php the_permalink() ?>" rel="bookmark"></a>
<a href="<?php the_permalink() ?>">
<div class="t1thumb">
<?php the_post_thumbnail( array(0,0) ); ?>
</a>
</div>
</div>
<div class="t2">
<a href="<?php the_permalink() ?>" rel="bookmark"></a>
<a href="<?php the_permalink() ?>">
<h3><?php the_title(); ?></h3>
</a><br>
</div>

<?php endwhile; ?>


</div><!--End---->
<div class="bottom"><!--start---->
<div class="bt">
<div class="notes">بین الملل</div>
</div><br><br>
<?php $recent = new WP_Query("cat=160&showposts=5"); while($recent->have_posts()) : $recent->the_post();?>
<div class="t1">

<a href="<?php the_permalink() ?>" rel="bookmark"></a>
<a href="<?php the_permalink() ?>">
<div class="t1thumb">
<?php the_post_thumbnail( array(0,0) ); ?>
</a>
</div>
</div>
<div class="t2">
<a href="<?php the_permalink() ?>" rel="bookmark"></a>
<a href="<?php the_permalink() ?>">
<h3><?php the_title(); ?></h3>
</a><br>
</div>

<?php endwhile; ?>


</div><!--End---->

css :


.bottom{float:right;position:relative;width:240px;height:330px;border-left:1px solid #000;border:1px solid #e7e6e6;overflow:hidden;margin:0 5px 5px 0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;direction:rtl;text-align:right;}
.bt{position:relative;width:230px;height:20px;margin:3px 3px 3px 3px;font-family:ST,times New Roman;font-size:17px;font-weight:normal;margin:3px 3px 3px 3px;}
.video{float:right;position:relative;width:230px;height:auto;background:url(images/posht4.jpg) no-repeat;font-family:ST,times New Roman;font-size:17px;font-weight:normal;margin:3px 3px 3px 3px;}
.image{float:right;position:relative;width:230px;height:auto;background:url(images/posht5.jpg) no-repeat;font-family:ST,times New Roman;font-size:17px;font-weight:normal;margin:3px 3px 3px 3px;}
.article{float:right;position:relative;width:230px;height:auto;background:url(images/posht2.jpg) no-repeat;direction:rtl;font-family:ST,times New Roman;font-size:17px;font-weight:normal;margin:3px 3px 3px 3px;}
.notes{float:right;position:relative;width:230px;height:auto;background:url(images/posht3.jpg) no-repeat;font-family:ST,times New Roman;font-size:17px;font-weight:normal;margin:3px 3px 3px 3px;}
.t1{float:right;position:relative;width:0px;height:0px;margin:10px 10px 0 0px;direction:rtl;}
.t2{float:right;position:relative;width:230px;50px:auto;margin:2px 2px 0 0px;}
.t2 h3 {padding-top:5px;padding-right:2px;font-family:tahoma;font-size:12px;font-weight:normal;height:auto;line-height:19px;text-align:right;}
.dl{direction:rtl;text-align:right;display:block;direction:rtl;font-size:8px;font-weight:normal;height:19px;line-height:16px;text-align:right;width:auto;word-spacing:1px;}
padding:5px;}
*{direction:rtl;}

لینک به ارسال

سلام

از خصوصیت overflow در css استفاده کنید. مثال :

http://www.w3schools.com/cssref/tryit.asp?filename=trycss_overflow


overflow:scroll;

  • امتیاز 4
لینک به ارسال

سلام

از خصوصیت overflow در css استفاده کنید. مثال :

http://www.w3schools...trycss_overflow


overflow:scroll;

اسکرول شد ... !

حالا میشه بهش یه استایل داد ؟؟؟ این زیاد جال نیست!!!؟

لینک به ارسال

بله میشه .

1 ـ برای مرورگرهای webkit :

مجموعه استایل هایی که می تونید بدید ، مثلا رنگ اسکرول بار و ..


::-webkit-scrollbar { /* 1 */ }
::-webkit-scrollbar-button { /* 2 */ }
::-webkit-scrollbar-track { /* 3 */ }
::-webkit-scrollbar-track-piece { /* 4 */ }
::-webkit-scrollbar-thumb { /* 5 */ }
::-webkit-scrollbar-corner { /* 6 */ }
::-webkit-resizer { /* 7 */ }

در عکس نگاه کنید که هر شماره به استایل کجای اسکرول مربوط میشه :

post-631-0-97161200-1384526841_thumb.png

مثلا من 1 استایل دلخواه خودم براتون میذارم که متوجه شید :


::-webkit-scrollbar {
width: 12px;
}

::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
border-radius: 10px;
}

::-webkit-scrollbar-thumb {
border-radius: 10px;
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5);
}

2 ـ برای IE باید از این کد استفاده کنید :


body {
scrollbar-face-color: #b46868;
}

3 ـ برای مرورگرهای غیر از webkit :

برای این مرورگر ها از یه پلاگین جی کوئری استفاده می کنیم . پس از دانلود فایل های این پلاگین اونا رو فراخونی کنید :


<!-- this cssfile can be found in the jScrollPane package -->
<link rel="stylesheet" type="text/css" href="jquery.jscrollpane.css" />
<!-- latest jQuery direct from google's CDN -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<!-- the jScrollPane script -->
<script type="text/javascript" src="jquery.jscrollpane.min.js"></script>
<!--instantiate after some browser sniffing to rule out webkit browsers-->
<script type="text/javascript">
$(document).ready(function () {
if (!$.browser.webkit) {
$('.container').jScrollPane();
}
});
</script>

حالا برای ست کردن استایل اسکرول با چیزی که مد نظرتون هست فایل زیر رو که در پک پلاگین هست ، باز کنید و به دلخواه استایل هاتون رو بدید

jquery.jscrollpane.css

مثلا من استایلش رو به این استایل ها عوض میکنم :


.jspTrack
{
background: #b46868;
position: relative;
}
.jspDrag
{
background: rgba(0,0,0,0.2);
position: relative;
top: 0;
left: 0;
cursor: pointer;
}

  • امتیاز 7
لینک به ارسال

الان من یک استایل خاص برای مرورگر های webkit پیدا کردم ... ! حالا میخام همین استایل برای مرورگر های غیر webtik هم نشون داده بشه ... ! چطور باید مثل هم کنمشون

+

بعد از اضافه کردن اسکرول برای کادر داخل سایت ؛ اسکرول خوده مرورگر هم عوض میشه ...

ویرایش شده توسط honda.moji
لینک به ارسال

هر استایلی که برای وی کیت ها بالا بیاد لزوما قابل استفاده در بقیه مرگروها نیست

  • امتیاز 2
لینک به ارسال

لطفا برای ارسال دیدگاه وارد شوید

شما بعد از اینکه وارد حساب کاربری خود شدید می توانید دیدگاهی ارسال کنید



ورود به حساب کاربری
×
×
  • اضافه کردن...