小编luk*_*sak的帖子

如何在jQuery中添加当前选择器的所有兄弟节点

我试过这个,但它不起作用:

$('div').add($(this).siblings());
Run Code Online (Sandbox Code Playgroud)

我想同时为兄弟姐妹制作动画.有人可以帮忙吗?

jquery

22
推荐指数
1
解决办法
4563
查看次数

在IE 8中,使用jquery的load事件失败

我写了一个jquery插件来缩放图像.在ie 8中,大图像的加载事件失败.我试着像这样:

        var fullImage = container.find(options.fullSelector);
        fullImage.attr('src', fullImageUrl).bind('load', function() {
            content.fadeOut(options.fadeSpeed, function(){
                if(slideContent.size()){
                    slideContent.slideUp(options.resizeSpeed, function(){
                        smallImage.hide();
                        fullImage.show();
                        fullImage.parent().andSelf().stop().animate({ width: options.fullWidth + 'px' }, options.resizeSpeed);
                    });
                }
                else{
                    smallImage.hide();
                    fullImage.show();
                    fullImage.parent().andSelf().stop().animate({ width: options.fullWidth + 'px' }, options.resizeSpeed);
                }
            });
        });
Run Code Online (Sandbox Code Playgroud)

错误说:对象不支持属性或方法.

我究竟做错了什么?

谢谢

jquery internet-explorer-8

10
推荐指数
1
解决办法
7678
查看次数

是否有用作CSS背景的SVG的polyfill?

我想使用SVG,而不是每次都要创建一个PNG后备.这是一个简单的解决方案吗?我看过这些项目,但无法判断它们是否支持它:

http://sie.sourceforge.jp/

http://code.google.com/p/svgweb/

css svg polyfills

7
推荐指数
1
解决办法
1854
查看次数

MediaElement播放器"成功"回调未被执行,如果使用闪回后备,则可能不会触发"已结束"事件

我使用以下代码嵌入视频:

$('#trailer-dialog').mediaelementplayer({
        enablePluginDebug: false,
        // remove or reorder to change plugin priority
        plugins: ['flash','silverlight'],
        // specify to force MediaElement to use a particular video or audio type
        type: '',
        // path to Flash and Silverlight plugins
        pluginPath: '/build/',
        // name of flash file
        flashName: 'flashmediaelement.swf',
        // name of silverlight file
        silverlightName: 'silverlightmediaelement.xap',
        // default if the <video width> is not specified
        defaultVideoWidth: 1240,
        // default if the <video height> is not specified    
        defaultVideoHeight: 679,
        // overrides <video width>
        pluginWidth: -1, …
Run Code Online (Sandbox Code Playgroud)

javascript flash jquery internet-explorer mediaelement.js

6
推荐指数
1
解决办法
3797
查看次数

Ajaxy - 添加要求的参数

我正在使用jQuery Ajaxy插件:http://balupton.com/projects/jquery-ajaxy

有没有办法为每个Ajaxy请求添加POST参数?

ajax jquery

5
推荐指数
1
解决办法
2万
查看次数

如何获得具有display:none的父元素的元素的高度?

如何获得具有父元素的元素的高度display: none

这里有一个例子:jsfiddle.net

谢谢

卢卡斯

html css jquery

4
推荐指数
1
解决办法
149
查看次数

t()函数不会将字符串添加到翻译界面

我在我的一个视图中使用customfiel php代码来翻译字符串,因为2.x的视图在本地化方面很糟糕.我使用以下PHP代码:

echo t('Watch Video');
Run Code Online (Sandbox Code Playgroud)

但字符串不会出现在"翻译界面"部分.

谢谢你的帮助.

卢卡斯

translation drupal views

4
推荐指数
1
解决办法
2161
查看次数

克隆子模块失败

我正在尝试为我的drupal安装克隆一个子模块.我运行以下命令:

git submodule add http://git.drupal.org/project/token.git /sites/all/modules/token
Run Code Online (Sandbox Code Playgroud)

这会引发此错误:

The following path is ignored by one of your .gitignore files:
/sites/all/modules/token
Use -f if you really want to add it.
Run Code Online (Sandbox Code Playgroud)

但我的.gitignore文件是空的.

所以我尝试按照建议运行它:

submodule add -f http://git.drupal.org/project/token.git /sites/all/modules/token
Run Code Online (Sandbox Code Playgroud)

但是这会抛出这个错误:

fatal: could not create leading directories of '/sites/all/modules/token': Permission denied
Clone of 'http://git.drupal.org/project/token.git' into submodule path '/sites/all/modules/token' failed
Run Code Online (Sandbox Code Playgroud)

权限是777.

想法?

关心卢卡斯

git drupal git-submodules

4
推荐指数
1
解决办法
3852
查看次数

CSS旋转动画仅适用于Webkit

我想要一个无限旋转360度的元素.这是我的代码:

.rotate-animation {
  -webkit-animation: rotate 2s linear 0 infinite normal;
  -moz-animation: rotate 2s linear 0 infinite normal;
  -o-animation: rotate 2s linear 0 infinite normal;
  -ms-animation: rotate 2s linear 0 infinite normal;
  animation: rotate 2s linear 0 infinite normal;
}

@-webkit-keyframes rotate {
  from {
    -webkit-transform: rotate(0deg);

  }
  to { 
    -webkit-transform: rotate(360deg);
  }
}

@-moz-keyframes rotate {
  from {
    -moz-transform: rotate(0deg);

  }
  to { 
    -moz-transform: rotate(360deg);
  }
}

@-o-keyframes rotate {
  from {
    -o-transform: rotate(0deg);

  }
  to { 
    -o-transform: rotate(360deg);
  } …
Run Code Online (Sandbox Code Playgroud)

css animation css3

4
推荐指数
1
解决办法
5797
查看次数