小编Ria*_*cht的帖子

jQuery移动滑动在Windows Phone上不起作用

我使用jQuery Mobile的swiperight和swipeleft事件.它们在开发时在我的台式机和iphone上运行得非常好但是当我在我的Windows手机上测试它们时,两个事件都不会触发.

看起来很简单:

<div class="swiper">Content</div>
Run Code Online (Sandbox Code Playgroud)

和脚本

$(".swiper").swiperight(function(event){
    alert('swiperight');
});
$(".swiper").swipeleft(function(event){
    alert('swipeleft');
});
Run Code Online (Sandbox Code Playgroud)

与$(".swiper")相同的问题.live('swipeleft swiperight')

有人有解决方案吗?根据http://jquerymobile.com/blog/2012/08/01/announcing-jquery-mobile-1-2-0-alpha/,他们对Windows Phone提供A级支持.

mousemove swipe windows-phone jquery-mobile

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

Magento:在body类中显示自定义属性

我有一个自定义类别属性,我想添加到body类.据我所知,人们做的是什么

  1. 覆盖CategoryController并添加类似$root->addBodyClass($category->getMyAttribute());但我不想覆盖核心类...

  2. 在管理面板中,他们添加类似于<reference name=”root”><action method=”addBodyClass”><className>caravan-motorhome-lighting</className></action></reference>每个类别的内容,而不是使用属性本身,而是直接添加类.由于我已经有了一个属性,我当然不希望克隆它并以这种方式添加类.

所以我最喜欢的解决方案是我可以添加到local.xml的布局更新

<reference name=”root”>
    <action method=”addBodyClass”>
        <className>
            get value of my custom attribute here dynamically
        </className>
    </action>
</reference>
Run Code Online (Sandbox Code Playgroud)

有没有人知道这是如何工作的或我甚至没有想到的另一个想法?

magento magento-1.7

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