Hello.
I've been looking at
this website, however, along the way somewhere, I've missed something...
Can someone please help?
What I did: - If your to test, edit the JQuery link
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script>
$(document).ready(function() {
$('#slideleft button').click(function() {
var $lefty = $(this).next();
$lefty.animate({
left: parseInt($lefty.css('left'),10) == 0 ?
-$lefty.outerWidth() :
0
});
});
});
</script>
<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
<style>
.slide {
position: relative;
overflow: hidden;
height: 120px;
width: 350px;
margin: 1em 0;
background-color: #FFC;
border: 1px solid #999;
}
.slide .inner {
position: absolute;
left: 0;
bottom: 0;
width: 338px;
height: 36px;
padding: 6px;
background-color: #4C5;
color: #333;
}
</style>
</head>
<body>
<div id="slideleft" class="slide">
<button>slide it</button>
<div class="inner" style="left: 0px; ">Animate this element's left style property</div>
</div>
</body>
</html>
I'd like this not to be a button either, instead an image. This is going to be a vertical rectangle at the side, you click the image and it expands left so if your able to make it so this starts off hidden, please implement this.
Best Regards,
Tim