小编Luk*_*ull的帖子

绝对位置在浏览器之间的相对框中不同

我有一个子导航,放在不同浏览器的两个不同的地方,我不知道为什么.我确实意识到使用margin-top而不是top确实可以解决这个问题,但问题是当子导航出来时我有一个jQuery幻灯片动画,当我使用margin-top时它看起来不太好看比它更进一步.这是差异的图片:

http://jsfiddle.net/eAqev/ < - JS小提琴

Internet Explorer和Google Chrome之间的区别

HTML:

    <div id="navigation">
        <ul>
            <li><h1>01. About</h1><h2>Learn about us</h2></li>
            <li class="button"><h1>02. Products</h1><h2>View our selection of products</h2>
                <ul class="scrollDown">
                    <li><p>Kitchen Worktops</p></li>
                    <li><p>Upstands/Splashbacks</p></li>
                    <li><p>Gables/ Panels</p></li>
                    <li><p>Glass</p></li>
                    <li><p>High Gloss</p></li>
                    <li><p>Bathroom Tops</p></li>
                    <li><p>Sinks/ Taps</p></li>
                </ul>
            </li>
            <li><h1>03. Contact</h1><h2>Contact us!</h2></li>
            <li><h1>04. Gallery</h1><h2>View photos of us</h2></li>
        </ul>
    </div>
Run Code Online (Sandbox Code Playgroud)

CSS:

#navigation ul {
    display: inline;
    position: relative;
}

#navigation ul li {
    float: left;
    width: 200px;
    height: 35px;
    margin: 10px;
    list-style: none;
    border-bottom: 3px solid #ccc;
}

#navigation ul li:hover {
    border-bottom: 6px …
Run Code Online (Sandbox Code Playgroud)

html css position

3
推荐指数
1
解决办法
1184
查看次数

调用方法是给我代码而不是值(Javascript)

基本上我用一个方法创建了一个对象,该方法在对象中添加了几个属性.但是当我尝试将该方法调用到控制台日志时,它会向我发出代码(这是一个if语句),而不是我希望它返回的值,所以我很困惑!为什么会这样?代码如下:

var Granite = function(ty, gr, th, wi, le, ed, ad){
    this.type = ty;
    this.group = gr;
    this.thickness = th;
    this.width = wi;
    this.length = le;
    this.edgeProfile = ed;
    this.addOns = ad;
    this.groupPrice = function(){
        if (thickness === 20){
            switch(group)
            {
            case 1:
              return 160;
              break;
            case 2:
              return 194;
              break;
            case 3:
              return 244;
              break;
            case 4:
              return 288;
              break;
            case 5:
              return 336;
              break;
            case 6:
              return 380;
              break;
            default:
              return 380;
            }
        }else{
            switch(group)
            {
            case 1: …
Run Code Online (Sandbox Code Playgroud)

javascript methods console object

-1
推荐指数
1
解决办法
43
查看次数

标签 统计

console ×1

css ×1

html ×1

javascript ×1

methods ×1

object ×1

position ×1