function - jQuery Var issue -
function - jQuery Var issue -
can please assist this. want switch "winwidth" div id section: "#about".
the code is
function splitcolumns() { var winwidth = jquery(window).width() + 15, columnnumb = 1; if (winwidth > 1200) { columnnumb = 3; } else if (winwidth > 992) { columnnumb = 2; } else if (winwidth > 767) { columnnumb = 2; } else if (winwidth < 767) { columnnumb = 1; } homecoming columnnumb; } function setcolumns() { var winwidth = jquery(window).width(), columnnumb = splitcolumns(), postwidth = math.floor(winwidth / columnnumb); container.find('.portfolio-item').each(function() { jquery(this).css({ width : postwidth + 'px' }); }); }
the code came believe correct:
var container = $ (‘#about’).width() + 15, columnnumb = 1; if (container > 1200) { columnnumb = 3; } else if (container > 992) { columnnumb = 2; } else if (container > 767) { columnnumb = 2; } else if (container < 767) { columnnumb = 1; } homecoming columnnumb; }
so think need lastly few lines of code changed have no thought how to. fyi; have no formal training on js forgive ignorance.
jquery function if-statement var
Comments
Post a Comment