1

编辑:似乎隐藏和显示效果不起作用,但其他效果工作正常。

我试图在页面加载时使一些图形增长,但到目前为止它还没有工作。根本没有任何反应。问题是其他 jQuery 效果工作得很好。我会很感激任何帮助!

我的html;

<div id="graphics">

<div id="twitter"><p>social media connected</p></div>

<div id="seo"><p>search engine optimized</p></div>

<div id="hand"><p>easy to update</p></div>

<div id="responsive"><p>responsive</p></div>

</div>

和我的CSS;

#graphics {
margin: 170px auto 0 auto;
width:700px;
height:80px;
}

#graphics p{
margin-top:75px;
text-align:center;
font-size:1em;
}


#twitter, #seo, #hand, #responsive {
height:72px;
width:105px;
float:left;
margin-right:0px;
}


#twitter {
background-image:url(images/twitter.png);
margin-right:93px;
}

#seo {
background-image:url(images/seo.png);
margin-right:93px;
}

#hand{
background-image:url(images/hand.png);
margin-right:93px;
}

#responsive {
background-image:url(images/responsive.png);
}

最后是javascript代码;

$(document).ready(function() {
     $("#twitter").show( "scale", 
     {percent: 100, }, 2000 );
});
4

1 回答 1

0

我相信scale需要 jQuery UI。

您的代码中还有一个额外,的内容。

我能够通过最初隐藏元素并包括 jQuery UI 来获得效果:

例子

HTML:

<div id="twitter" style="display: none;"><p>social media connected</p></div>

代码:

$("#twitter").show( "scale", {percent: 100}, 2000 );
于 2013-09-02T21:33:04.280 回答