I have a jquery if statement that doesn’t quite work the way it should, I think it’s close, but doesn’t seem to quite want to work:
I’d like it to following the following:
if it’s a ios device I want it to do one thing, if it’s a window with a height greater then 500 px but less then 830 then do the other thing and if it’s neither of those things do the third thing
var deviceAgent = navigator.userAgent.toLowerCase();
var agentID = deviceAgent.match(/(iphone|ipod|ipad)/);
if(agentID) {
$("#about_container").css({
height: $(window).height() + 500
});
$("#about_main_header_container").css({
paddingBottom: (($(window).height() - $("#about_content_total").outerHeight(true)) /2) - 50
});
$("#services_wrapper").css({
height: $(window).height() + 190
});
$("#services_main_header_container").css({
paddingBottom: (($(window).height() - $("#services_container").outerHeight(true)) /2) - 10
});
}
else if ($(window).height() > 500, $(window).height() < 830) {
$("#about_container").css({
height: 830
});
$("#services_wrapper").css({
height: 830
});
$("#services_main_header_container").css({
paddingBottom: 160
});
$("#about_main_header_container").css({
paddingBottom: 130
});
}
else {
$("#about_container").css({
height: $(window).height() - 65
});
$("#about_main_header_container").css({
paddingBottom: (($(window).height() - $("#about_content_total").outerHeight(true)) /2) - 175
});
$("#services_wrapper").css({
height: $(window).height() - 100
});
$("#services_main_header_container").css({
paddingBottom: (($(window).height() - $("#services_container").outerHeight(true)) /2) - 175
});
}
is not right, it should be:
In javascript,
a,bwill just returnb.