Skip to content

Instantly share code, notes, and snippets.

@dchentech
Created December 5, 2012 09:24
Show Gist options
  • Save dchentech/4214223 to your computer and use it in GitHub Desktop.
Save dchentech/4214223 to your computer and use it in GitHub Desktop.
css hack技巧

div height in percent, and unwanted scrollbar http://stackoverflow.com/a/10607261/595618

if you want to use % as height you have to put that in every parent element:

maybe you could set the container absolute, but that not really a proper coding style.

页面加载时整个页面瞬间闪动

把外引js加载放到页面最下方即可

鼠标移过时切换图片

定义两个要切换的标签,把其中一个设为display:none; 在JS里同时toggle这两个标签显示。

%span.icon-chevron-down.pull-right
%span.icon-chevron-up.hide.pull-right
$(".navbar .user-info").hover(function() {
  $(".navbar .user-info .menu, .navbar .user-info .icon-chevron-up, .navbar .user-info .icon-chevron-down").toggle();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment