My website has a unique background image through CSS, creating the look of a blueprint schematic with a white grid on a blue background.
CSS:
html
{
display: block;
position: absolute;
background: url(../assets/background.jpg) repeat;
color: #FFF;
margin: 0px;
padding: 0px;
border: none;
}
Now, when a user clicks a button, I want to animate this background image sliding off towards the top-right direction, giving the impression of transitioning to another area within the large blueprint. However, I am struggling to access the background image from my CSS using jQuery.
JavaScript:
$("#button").click(function()
{
// Animate the webpage's background, causing it to move
$("html /* What should go here? */").animate({left: "-=10000px", top: "-=5000px"}, 1250);
});
I attempted adding a div in the body matching the screen size, but encountered issues with a white border around the image. As a result, I need to find a solution for implementing the image directly through CSS on the HTML selector to achieve the desired effect.
Any suggestions on how to make this effect work seamlessly?