javascript - Handling rows + cols (html) with hidden elements in JS -


Regarding my last question:

It is working as expected, but I One last thing

All elements will be displayed as a result of opening the site, something like this:

  & lt; Div class = "W-col w-col-4 Entry All Firewalls Troby Test" & gt; & Lt; Div class = "w-col w-col-4 entry alfairwalls trombie" & gt; & Lt; Div class = "w-col w-col-4 entry Komplett neues" & gt; & Lt; Div class = "w-col w-col-4 entry trobi neu" & gt;  

You help me understand how to wrap 3 divs in 1 row, which I felt like this:

  function handleRows ( ) For {var divs = $ (". Galrows.w-line> .w-col") (var i = 0; i & lt; divs.length; i + = 3) {divs.slice (i , I + 3). WrapAll ("& lt; div class = 'w-row'> "); }}  

I have not mentioned that point before: after clicking on a filter (which is Pure JS and not AJAX < / Code>) Some elements are hidden

  & lt; Div class = "w-row" & gt; & Lt; Div class = "w-col w-col-4 entry abc def" & gt; & Lt; Div class = "w-col w-col-4 entry abc 123" & gt; & Lt; Div class = "w-col w-col-4 entry 1234" style = "display: none;" & Gt; & Lt; / Div & gt; & Lt; Div class = "w-row" & gt; & Lt; Div class = "w-col w-col-4 entry new_filter" & gt; & Lt; A href = "/ referenzseiten / mein-beispiel /" & gt; & Lt; Div & gt; & Lt; / DiV  

You know what the problem is: the item should not be in this row with the element style "Display: None", it looks a little longer:

| X | X | | | X | | |

(where x = image is shown)

I handleRows () to document.ready Calling> Part and after applying a filter:

  $ (document) .ready (function () {handleRows ();}); // Code $ ('entry') later Each (function () {if (! $ (This) .hasClass (filtername)) $ $ (this). FadeOut ();} else {handleRows (); $ (this) .FadeIn ();}});  

Hope you have an idea in advance thanks

You must use the jQuery Pseudo-selector to filter the match set set with DV:

/ code> and fadeIn () Methods work in an inactive (aka), you can give unexpected behavior (perhaps using related callback). Difficult to say without a relevant sample online inquiry.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -