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 ..?
Comments
Post a Comment