CSS
3
Вклад в тег
$(document).ready(function(){
// viewport stuff
var targetWidth = 1101;
var deviceWidth = 'device-width';
var viewport = $('meta[name="viewport"]');
// check to see if local storage value is set on page load
localStorage.isResponsive = (localStorage.isResponsive == undefined) ? 'true' : localStorage.isResponsive;
var showFullSite = function(){
viewport.attr('content', 'width=' + targetWidth);
if(!$('#view-options #view-responsive').length){
$('#view-options').append('<div id="view-responsive" class="blue_button">Мобильная версия сайта</div>');
}
localStorage.isResponsive = 'false';
console.log('no');
}
var showMobileOptimized = function(){
localStorage.isResponsive = 'true';
viewport.attr('content', 'width=' + deviceWidth);
console.log('yes');
}
// if the user previously chose to view full site, change the viewport
if(Modernizr.localstorage){
if(localStorage.isResponsive == 'false'){
showFullSite();
}
}
$("#view-full").on("click", function(){
showFullSite();
});
$(document).on('click', '.parent_order', function() {
});
$('#view-options').on("click", "#view-responsive", function(){
showMobileOptimized();
});
});
// Ajax comments
$.ajaxSetup({cache:false});
$(".nav-next a").click(function(event){
event.preventDefault();
$(this).hide();
var post_link = $(this).attr("href");
$("#single-post-container").load(post_link+" li.comment");
$(".commentlist").append($("#single-post-container"));
return false;
});