Welcome Guest, Not a member yet? Register   Sign In
Javascript Question
#1

I thought I would post this question on here but not much to do with CI

I have a img which I am using holder.js


Code:
<div class="header-wrapper ">
<img id="image" data-src="holder.js/100px380?theme=social" class="img-responsive">
</div>


I need to get the height of the img on my javascript but all ways return 0

Code:
<script>
$(document).ready(function(){
 var height = $(".header-wrapper img").height();

 alert($(".header-wrapper img").height());

 if ($(document).scrollTop() > height) {
   $(".navbar-fixed-top").css("background-color", "#f8f8f8");
 } else {
   $(".navbar-fixed-top").css("background-color", "#EEEEEE");
 }
});
</script>

Any ideas and examples?
There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!
Reply


Messages In This Thread
Javascript Question - by wolfgang1983 - 06-24-2016, 01:22 AM
RE: Javascript Question - by ivantcholakov - 06-24-2016, 06:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB