The width of the div "topNav" changes by few pixels when its position style is changed from relative to fixed. I found a jquery plugin (/) which can perform the same functionality I'm looking for elegantly, but I feel it is a overkill for this purpose.
EDIT: My question is how to avoid changing the div sizes.
Check out the code at :
The width of the div "topNav" changes by few pixels when its position style is changed from relative to fixed. I found a jquery plugin (http://imakewebthings.github./jquery-waypoints/) which can perform the same functionality I'm looking for elegantly, but I feel it is a overkill for this purpose.
EDIT: My question is how to avoid changing the div sizes.
Check out the code at :
http://jsbin./azace5/edit
Share Improve this question edited Jun 15, 2011 at 21:32 brayne asked Jun 15, 2011 at 21:11 braynebrayne 1,4032 gold badges17 silver badges28 bronze badges 1- What is the functionality you are looking to implement elegantly? – cmwright Commented Jun 15, 2011 at 21:15
2 Answers
Reset to default 5You need to remove the page's "default margin". This will do it in "every browser":
html, body {
margin: 0;
padding: 0
}
See: http://jsbin./azace5/2
Or you can add a minimum width.
min-width:600px;
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745465793a4628914.html
评论列表(0条)