当前位置: 代码迷 >> Web前端 >> 卡通片效果
  详细解决方案

卡通片效果

热度:112   发布时间:2013-07-20 11:07:48.0
动画效果

<html>
<head>
<script language="javascript" src="jquery.min.js" />
<script language="javascript">
$(function(){
?$("input:first").click(function(){
??${"p"}.hide(1000);
?});
?$("input:last").click(function(){
??${"p"}.show();
?});
?$("input:eq(2)").click(function(){
??${"img"}.fadeIn();
??//${"img"}.fadeOut();
??//slideUp(),slideDown()展示幻灯片的效果
??$("div").add("img").slideUp(1000)
?});

?
});
function detect(){
?if($.browser.msie){
??return "IE";
?}else if($.browser.mozilla){
??return "Mozilla";
?}
}
var sBrowser = detect();
document.write("浏览器"+sBrowser+"<br>版本"+$.browser.version);
//盒子模型是对内容的长宽定义的范围问题,在Document头信息声明时可以改变
//$.boxModel?"标准W3C":"IE"
$.each(object,fn);
fn函数将对object进行处理
//针对对象
$.each($.browser,function(property,value){
?document.write("属性"+property+"值"+value)
})
//对数组大于4的数进行过滤
$.grep(Array,function(value){
?return value>4;
})
var arr=["a","b","c"];
//设置p标记里的文本
$("p:eq(0)").text(arr.join());
//对数组的值进行转换
arr = $.map(arr,function(value,index){
?return (value.toUpperCase()+index);
})
</script>
</head>
<body>
?<input type="button" value="Hide">
?<input type="button" value="Show">
?<img src="02.jpg"></p>
?<p>点击按钮,看看效果<br>
?<span>一段其它的文字</span>
?<div></div>
</body>
</html>

  相关解决方案