Skip to main content

Bug Tracker

Side navigation

Ticket #1347: ulWidth.html
File ulWidth.html, 0.8 KB (added by sidebog7, July 03, 2007 10:46AM UTC)

Example of error

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>untitled</title>
	<script src="jquery.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
		function test()
		{
			$('#test1').text('Hidden width = ' + $('ul').width());
			$('ul').css('visibility', 'visible');
			$('#test2').text('Displayed width = ' + $('ul').width());
		}
	</script>
<style type="text/css">
ul {margin:0px;
			padding:0px;
			position:absolute;
			z-index:2;
			visibility:hidden;
			list-style:none;}
</style>

</head>
<body style="margin:0px">

<ul><li>test</li></ul>

<input type=button value="Click to test" onclick="test()">
<p id="test1"></p>
<p id="test2"></p>
</body>
</html>

Download in other formats:

Original Format