i have following javascript function:
function reglare(){ alert("inaltime imagine= "+$(".slider img").height()); } i call function on window resize, this:
$(window).resize(function(){ reglare(); }); most of times output image height, output 0.
how can fix in order actual image size on window resize times?
later edit: why need this?
the code this:
<div id="slideshow" class="latime_100"> <img src="poze/sageata_st.png" class="navigare" id="navigare_st" onclick="go_prev();"></img> <div id="slider_1" class="slider" > <img src="../poze/imagine_slide1_iul_fade.png"></img> </div> <div id="slider_2" class="slider"> <img src="../poze/imagine_slide2_iul_fade.png"></img> </div> <div id="slider_3" class="slider"> <img src="../poze/imagine_slide3_iul_fade.png"></img> </div> <img src="poze/sageata_dr.png" class="navigare" id="navigare_dr" onclick="go_next();"></img> </div> i have container div slideshow position relative containing more absolute positioned divs. because position absolute, container not extend content below gets overlapped.
here's fiddle: https://jsfiddle.net/g6ppqxlf/5/
to display error have in fiddle: resize browser few times , follow alert message: output 0.
the jquery class selector returns array.
https://api.jquery.com/class-selector/
function reglare(){ (var = 0; < $("img.slider").length; i++){ alert($("img.slider")[i].attr("height"); } } this alerts attribute height of each image class .slider
hope searched for
Comments
Post a Comment