Bu kodu bilen varmı? |
15 Mesajlar | 2.094 Okunma |
$(document).ready(function() {
var theLoc = $('#sidebar').position().top;
$(window).scroll(function() {
if(theLoc >= $(window).scrollTop()) {
if($('#sidebar').hasClass('fixed')) {
$('#sidebar').removeClass('fixed');
}
} else {
if(!$('#sidebar').hasClass('fixed')) {
$('#sidebar').addClass('fixed');
}
}
});
});
#sidebar {
float: right;
margin-top: 40px;
width: 160px;
color: #444;
}
.fixed {
position: fixed;
top: 0px;
margin-left: 540px;
}
$(document).ready(function() {
var theLoc = $('#sidebar').position().top;
$(window).scroll(function() {
if(theLoc >= $(window).scrollTop()) {
if($('#sidebar').hasClass('fixed')) {
$('#sidebar').removeClass('fixed');
}
} else {
if(!$('#sidebar').hasClass('fixed')) {
$('#sidebar').addClass('fixed');
}
}
});
});
#sidebar {
float: right;
margin-top: 40px;
width: 160px;
color: #444;
}
.fixed {
position: fixed;
top: 0px;
margin-left: 540px;
}
{block:PostSummary}{PostSummary} - {/block:PostSummary}{Title}
<script></script>
{block:IfSidebarfixesattop}
<script></script>
{/block:IfSidebarfixesattop}
{block:IfEndlessScrolling}<script>src="http://static.tumblr.com/q0etgkr/mFbkoqlkr/tumblrautopager.js "></script>{/block:IfEndlessScrolling}
{block:IfHeaderImage}{/block:IfHeaderImage}
{block:IfNotHeaderImage}{Title}{/block:IfNotHeaderImage}
<script>
$("h1").contents().stretch();
</script>
{block:Posts}
{block:Text}
{block:Title}{Title}
{/block:Title}
{Body}
{/block:Text}
{block:Photo}
{LinkOpenTag}{LinkCloseTag}
{block:Caption}{Caption}{/block:Caption}
{/block:Photo}
{block:Photoset}
{Photoset-500}
{block:Caption}{Caption}{/block:Caption}
{/block:Photoset}
{block:Quote}
"{Quote}"
{block:Source}{Source}{/block:Source}
{/block:Quote}
{block:Link}
{Name}
{block:Description}{Description}{/block:Description}
{/block:Link}
{block:Chat}
{block:Title}
{Title}
{/block:Title}
{block:Lines}
-
{block:Label}{Label}{/block:Label}
{Line}
{/block:Lines}
{/block:Chat}
{block:Audio}
{block:AlbumArt}{/block:AlbumArt}{AudioPlayerGrey}
{Caption}
{/block:Audio}
{block:Video}
{Video-500}
{Caption}
{/block:Video}
{block:Answer}
{Asker} asked: {Question}
{Answer}
{/block:Answer}
{block:Date}{block:IfShowDate}{DayOfMonth} {ShortMonth} {Year} / {/block:IfShowDate}{block:RebloggedFrom}Reblogged from {ReblogParentName} with{/block:RebloggedFrom} {block:IfNotShowDate}{/block:IfNotShowDate}{NoteCountWithLabel}{block:IfNotShowDate}{/block:IfNotShowDate}{block:IfShowTags}
{block:HasTags} / {block:Tags}{Tag} {/block:Tags}{/block:HasTags}{/block:IfShowTags}{/block:Date}
{/block:Posts}
{block:PermalinkPage}
{block:PostNotes}
{PostNotes}
{/block:PostNotes}
{/block:PermalinkPage}