Hi guys, I'm trying to scroll the background image to the left using the animate marginRight property, which is activated by clicking a link, but it doesn’t work. The strange thing is that when I use marginLeft, it works, its just back. Here is my test site , and here is my broken jQuery code: (Again, I am trying to get a background image to scroll left). please let me know if I can post anything else to make it easier for you.
<script type="text/javascript">
jQuery(document).ready(
function(){
jQuery('#homelink').click(
function(){
jQuery('#SiteBackground').animate({
marginRight : "1000px"
},10000);
});
});
</script>
and my html: (#SiteBackground is what I want to move left and #homelink is an activator)
<img id="SiteBackground" src="/jscottsavage/media/Main/Backdrop.jpg" style="position: absolute; left: 0px; top: 0px; z-index: -1; height: 384px;">
<div id="homelink">Home</div>
source
share