Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function fixContentSize() {
- var w = $("section.body > section.middle").outerWidth();
- w = ($(document).width() - w) / 2;
- $("section.body > section.left").width(Math.ceil(w));
- $("section.body > section.right").width(Math.floor(w));
- var contentSectionsInner = $("section.body > section.middle > section > section.content.bare > section.content");
- fixContentHeight(contentSectionsInner, 11);
- var contentSections = $("section.body > section.middle > section > section.content");
- fixContentHeight(contentSections, (contentSectionsInner.length == 0 ? 11 : 1));
- }
- function fixContentHeight(contentElems, margin) {
- contentElems.each(function(index){
- var contentSection = $(this);
- var h = contentSection.outerHeight();
- h = Math.max(1, Math.round((h / 28))) * 28 - margin;
- contentSection.height(h);
- });
- }
- $(window).ready(function(){
- setTimeout(fixContentSize, 50);
- });
- $(document).ready(function(){
- var region_picker = $("#region-picker");
- var page_intro = $("div.page-intro");
- var region_intros = $("div.region-intro");
- var current_intro = page_intro;
- region_picker.on('change', function(e, old_selection, new_selection){
- current_intro.fadeOut(function() {
- if(new_selection != null) {
- var region_id = new_selection.data('region-id');
- var region_intro = region_intros.filter('[data-region-id=' + region_id + ']');
- current_intro = region_intro;
- } else {
- current_intro = page_intro;
- }
- current_intro.fadeIn();
- });
- var curScroll = $(document).scrollTop();
- var maxScroll = $(".begin").offset().top;
- if(curScroll > maxScroll)
- $("html, body").animate({scrollTop: maxScroll + "px"});
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement