小编Tim*_*ure的帖子

旋转Glyphicons /字体在Bootstrap中很棒

我试图让我的引导站点中的glyphicons在悬停时旋转(除了改变颜色).

这是我的尝试:http://jsfiddle.net/young_greedo17/88g5P/

...使用此代码:

<div class="widgetbox">
    <br><br>
    <div class="icon-calendar icon-large"></div>
    <h5>Add an event</h5>
</div>
Run Code Online (Sandbox Code Playgroud)

......这是CSS:

.widgetbox {
    width: 250px;
    height: 250px;
    background-color: black;
    color: white;
    text-align: center;
}
.widgetbox [class*="icon-"] {
    -webkit-transition-duration: 1.0s;
    -moz-transition-duration: 1.0s;
    -o-transition-duration: 1.0s;
    transition-duration: 1.0s;

    -webkit-transition-property: -webkit-transform;
    -moz-transition-property: -moz-transform;
    -o-transition-property: -o-transform;
    transition-property: transform;
}
.widgetbox:hover [class*="icon-"] {
    color: #24a159 !important;
    -webkit-transform:rotate(360deg);
    -moz-transform:rotate(360deg);
    -o-transform:rotate(360deg);
    transform:rotate(360deg);
}
Run Code Online (Sandbox Code Playgroud)

这是我想要在悬停时发生的一个例子(参见四个小部件框ATF):http://themeforest.net/item/flatnica-ultimate-flat-template/full_screen_preview/5343665

显然,颜色会发生变化,但即使这样也不会根据我为CSS过渡设置的参数而改变.

谢谢!

css twitter-bootstrap font-awesome

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

Sequelize 模型 - 删除具有belongsToMany n:m 关联的项目

我正在尝试为我的应用程序设置 DELETE 路由,该路由将 Sequelize 与 Postgres 数据库结合使用。我有两个不同的模型,“产品”和“兴趣”(将兴趣视为一种类别或标签)。产品可以有多个兴趣,兴趣可以有多个产品,所以我使用了belongsToMany关联。其结果是,我有三个表:ProductsInterests,和ProductInterests。这是我设置关联的方式:

对于产品:

Product.belongsToMany(models.Interest, {
    foreignKey: 'productId',
    through: models.ProductInterest,
    as: 'interests',
    onDelete: 'CASCADE',
    hooks: true
});
Run Code Online (Sandbox Code Playgroud)

兴趣:

Interest.belongsToMany(models.Product, {
    through: models.ProductInterest,
    as: 'products',
    foreignKey: 'interestId',
    onDelete: 'CASCADE',
    hooks: true
});
Run Code Online (Sandbox Code Playgroud)

这是在我的产品控制器中调用的方法:

destroy(req, res) {
    return Product
        .findById(req.params.productId, {
            include: [
                {
                    association: Product.associations.interests
                }
            ]
        })
        .then((product) => {
            if (!product) {
                return res.status(404).send({
                    message: 'Product not found'
                });
            }
            return product
                .destroy()
                // I've also tried …
Run Code Online (Sandbox Code Playgroud)

postgresql node.js sequelize.js

6
推荐指数
2
解决办法
8876
查看次数