I'm attempting to create a jQuery function that will automatically resize a particular image to it's parent's width. If it's relevant this is for vbulletin 4.2.0
Here's the relevant (simplified) code:
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
var newWidth = $('.floatcontainer.doc_header').css("width");
$('.logo-image').css("width", newWidth);
});
</script>
</head>
<div class="floatcontainer.doc_header" style="width: 90%; height: 200px;">
<img class=".logo-image" src="/img/headerimg.jpg"/> //the image is naturally 1092x200
</div>
SOLVED! I finally figured out where to go to edit the css for this picture, so I didn't need to do it with jQuery. Not exactly the solution I was looking for, but hey - who's complaining!
Thanks for your help!