Помогите разобраться с сайтом!
Всем привет и заранее спасибо за помощь.
Решил я сделать сайт.(Просто так, для себя) По ходу работы возникало много проблем, но пока не смог решить только 2: 1. Если меняю размер окна браузера появляется ненужный скроллер на блоке #content. 2. Если размер страниц (Page 1, Page 2...) разный, то внизу страниц, которые меньше максимальной, остается свободное пространство. Вот ссылка: http://h92177or.bget.ru И код: *HTML не вместился, посмотрите по вышеуказанной ссылке* JS
/*Floating menu*/
$(function(){
var h_nav = $('#top_nav').outerHeight();
var top;
$(window).scroll(function(){
top = $(this).scrollTop();
if(($('.firstScreen').outerHeight()-top) <= h_nav){
$('#top_nav').css('top','0');
}
else if(top < $('.firstScreen').outerHeight() && top > 0){
$('#top_nav').css({'bottom' : top, 'top':''});
}
else if(top < h_nav){
$('#top_nav').css({'top':'','bottom':'0'});
}
});
});
/*Smooth scrolling*/
/*Horizontal*/
$(document).ready(function() {
$('a.go_to').click(function() {
$('a.go_to').removeClass('selected');
$(this).addClass('selected');
current = $(this);
$('#content').scrollTo($(this).attr('href'), 800);
return false;
});
$(window).resize(function() {
resizePanel();
});
});
function resizePanel() {
width = $(window).width();
height = $(window).height();
mask_width = width * $('.content').length;
$('#debug').html(width + ' ' + height + ' ' + mask_width);
$('#content, .content').css({
width: width,
height: height
});
$('#mask').css({
width: mask_width,
height: height
});
$('#content').scrollTo($('a.selected').attr('href'), 0);
}
/*Vertuval*/
$(document).ready(function(){
$('.go_to').click( function(){
var scroll_el = $(this).attr('href');
if ($(scroll_el).length != 0) {
$('html, body').animate({ scrollTop: $(scroll_el).offset().top }, 800);
}
return false;
});
});
$(document).ready(function() {
$(window).resize(function () {
$("#content").css({"overflow-x":"hidden", "overflow-y":"visible"})
});
});
$('#content').on({
'mousewheel': function(e) {
if (e.target.id == 'content') return;
e.preventDefault();
e.stopPropagation();
}
})
CSS Код:
@import url(http://fonts.googleapis.com/css?family=Roboto:100,400&subset=latin,cyrillic); |
Цитата:
|
| Часовой пояс GMT +3, время: 15:06. |