Looking for a way to demo horizontal collapse pane with a simple web page that includes html, css, and jquery.
<html>
<head>
<script type="text/javascript" src="//code.jquery.com/jquery-1.10.1.js"></script>
<title>Sample HTML</title>
<style type="text/css">
html, body {
width: 100%;
height: 100%;
}
#map {
width: 10%;
height: 100%;
float: left;
}
#sidebar {
width: 89%;
height: 100%;
float: left;
border: 1px solid;
}
#toggle {
height: 10%;
float: right;
}
</style>
<script type="text/javascript">
$(window).load(function () {//this is error line
$(document).ready(function () {
$("#toggle").click(function () {
if ($(this).data('name') == 'show') {
$("#sidebar").animate({
width: '10%'
}).hide()
$("#map").animate({
width: '89%'
});
$(this).data('name', 'hide')
} else {
$("#sidebar").animate({
width: '89%'
}).show()
$("#map").animate({
width: '10%'
});
$(this).data('name', 'show')
}
});
});
});
</script>
</head>
<body>
<div id="map">
<input type="button" data-name="show" value="Toggle" id="toggle"></div>
<div id="sidebar">SIDEBAR</div>
</body>
</html>
Struggling with an issue in IE debugger where it hits at $(window).load(function ()
with an "Object expected" error message. Any ideas on why this isn't working?
Additionally, noticing that this page is loading quite slowly.