+ -
当前位置:首页 → 问答吧 → 关于调用数组内数据的问题

关于调用数组内数据的问题

时间:2009-10-26

来源:互联网

刚接触jQ没多久
像各位高手请教一个问题

复制代码
  1. (function($){
  2.     $(document).ready(function() {
  3.         var mask_animation = {
  4.             '{"weith": "toggle", "opacity": "toggle"}',
  5.             '{"height": "toggle", "opacity": "toggle"}',
  6.             '{"weith": "toggle", "height": "toggle", "opacity": "toggle"}'
  7.         };
  8.         $('#mask').animate({mask_animation[0]}, 1000);
  9.     });
  10. })(jQuery);


以上代码肯定是错误的,我是想从mask_animation中调用第一个数据库{"weith": "toggle", "opacity": "toggle"}从而让ID为mask的元素发生动画效果。
不知道怎么做。

作者: cheonnii   发布时间: 2009-10-26

修改成如下试试:
(function($){
    $(document).ready(function() {
        var mask_animation = [
            {"weith": "toggle", "opacity": "toggle"},
            {"height": "toggle", "opacity": "toggle"},
            {"weith": "toggle", "height": "toggle", "opacity": "toggle"}
        ];
        $('#mask').animate({mask_animation[0]}, 1000);
    });
})(jQuery);

作者: ldhh   发布时间: 2009-10-26

相关阅读 更多