jquery - How to change pagers width when window size changes? -


i have html code bx-slider pager

<div id="bx-custom-pager">                      <a data-slide-index="0" href="" style=""><div class="bx-item" style="" id="i1"></div></a>       <a data-slide-index="1" href="" style=""><div class="bx-item" style="" id="i2"></div></a>       <a data-slide-index="2" href="" style=""><div class="bx-item" style="" id="i3"></div></a>       <a data-slide-index="3" href="" style=""><div class="bx-item" style="" id="i4"></div></a>       <a data-slide-index="4" href="" style=""><div class="bx-item" style="" id="i5"></div></a> </div> 

and writed jquery code resize pagers width when resize window width

$(document).ready(function(){      var item = document.getelementsbyclassname('bx-item');     item.each(function detectwidth(){          item.style.width = 100 / 5 + 'px';     });     window.onresize = function (){          detectwidth();     }; }); 

but doesn't work , doesn't resize pagers ... please ..?

try

$( window ).resize(function() { ... $(this)...

https://api.jquery.com/resize/


Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -