sIFR 3 与 jQuery Cycle 插件兼容吗?

发布于 2024-08-05 13:22:42 字数 1661 浏览 3 评论 0原文

我是一个新手,我已经为此苦苦挣扎了一段时间。我尝试使用 jQuery Cycle 插件创建一个滚动 div,并在滚动 div 中包含 sIFR 3 文本。我可以让它在 Firefox 中正常工作,仅此而已。任何建议或帮助将不胜感激!

这是我的链接:http://dev.bandspecial.com/test.html

jQuery:

$(document).ready(function() {
$('#slideshow').cycle({
    fx: 'scrollLeft',
    cleartypeNoBg:  true
});
});

sIFR :

sIFR.replace(rockwell, {
 selector: 'h1',
      css: [ '.sIFR-root { color:#ffffff; }' ,'a { text-decoration: none }' ,'a:link { color: #E31824 }' ,'a:hover { color: #E31824 }' ], wmode: 'transparent'
    });

正文代码:

<div id="slideshow">
  <div> <img src="http://malsup.com/jquery/cycle/images/beach1.jpg" height="200" width="200">
    <h1>St Andrews State Park - Panama City, FL</h1>
    <p>This park is one of the most popular outdoor recreation spots in Florida. </p>
  </div>
  <div> <img src="http://malsup.com/jquery/cycle/images/beach2.jpg" height="200" width="200">
    <h1>Located in the Florida panhandle,</h1>
    <p> the 1,260 acre park is situated on a scenic peninsula and is well known for its sugar white sands and brilliant blue water. </p>
  </div>
  <div> <img src="http://malsup.com/jquery/cycle/images/beach3.jpg" height="200" width="200">
    <h1>The ocean provides opportunity for endless fun. </h1>
    <p>From boogie boarding to snorkeling to  swimming and boating, there is always something to do.</p>
  </div>
</div>

I am a newbie and I have been struggling with this for awhile. I am try to create a scrolling div using the jQuery Cycle Plugin with sIFR 3 text within the scrolling div. I can get it to work properly in Firefox and that's about it. Any suggestions or help would be greatly appreciated!

Here's my link: http://dev.bandspecial.com/test.html

jQuery:

$(document).ready(function() {
$('#slideshow').cycle({
    fx: 'scrollLeft',
    cleartypeNoBg:  true
});
});

sIFR:

sIFR.replace(rockwell, {
 selector: 'h1',
      css: [ '.sIFR-root { color:#ffffff; }' ,'a { text-decoration: none }' ,'a:link { color: #E31824 }' ,'a:hover { color: #E31824 }' ], wmode: 'transparent'
    });

Body Code:

<div id="slideshow">
  <div> <img src="http://malsup.com/jquery/cycle/images/beach1.jpg" height="200" width="200">
    <h1>St Andrews State Park - Panama City, FL</h1>
    <p>This park is one of the most popular outdoor recreation spots in Florida. </p>
  </div>
  <div> <img src="http://malsup.com/jquery/cycle/images/beach2.jpg" height="200" width="200">
    <h1>Located in the Florida panhandle,</h1>
    <p> the 1,260 acre park is situated on a scenic peninsula and is well known for its sugar white sands and brilliant blue water. </p>
  </div>
  <div> <img src="http://malsup.com/jquery/cycle/images/beach3.jpg" height="200" width="200">
    <h1>The ocean provides opportunity for endless fun. </h1>
    <p>From boogie boarding to snorkeling to  swimming and boating, there is always something to do.</p>
  </div>
</div>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

烟沫凡尘 2024-08-12 13:22:42

我稍微调整了汤姆的代码。虽然他的代码对我有用,但它在(淡入淡出)效果后明显呈现了 sifr。使用 before 和显示块,sifr 在效果之前渲染,以获得更理想的结果。

$(document).ready(function(){
    $('#div').cycle({
        fx: 'fade',
        before: function(){
            $(this).css({ 'display': 'block' })
            sIFR.replace(alberta, {
            selector: '.flash-text',
            wmode: 'transparent'
            });
       }
    });
});

I adjusted Tom's code a bit. Although his code works for me, it visibly renders the sifr after the (fade) effect. With a before and a display block, the sifr is rendered before the effect for a more desirable result.

$(document).ready(function(){
    $('#div').cycle({
        fx: 'fade',
        before: function(){
            $(this).css({ 'display': 'block' })
            sIFR.replace(alberta, {
            selector: '.flash-text',
            wmode: 'transparent'
            });
       }
    });
});
仙气飘飘 2024-08-12 13:22:42

我使用 Innerfade Jquery 插件,因此更改可能会略有不同。

这是我所做的:

Innerfade 使用 .hide() 隐藏列表中的所有项目。这就是问题的根源。
解决方案:不要让您的插件使用 .hide(),而是使用 .addClass("hide") 并定义 CSS position:absolute;左:-10000px

使用这种方法。 .removeClass("hide") 将使您的帖子再次出现。除此之外,如果您使用淡入淡出或幻灯片等效果,也不要忘记removeClass

我希望这是有道理的。顺便说一句:我正在使用 SIFR 3

I use the Innerfade Jquery plugin so the changes may be a little different.

Here is what I did:

Innerfade uses .hide() to hide all items in a list. This is the root of the problem.
Solution: instead of having your plugin utilize .hide(), use .addClass("hide") and define the CSS position: absolute; left:-10000px.

Using this method. .removeClass("hide") will make your post appear again. In addition to this, if you are using an effect like fade or slide don't forget to removeClass there as well.

I hope this makes sense. BTW: I am using SIFR 3

烧了回忆取暖 2024-08-12 13:22:42

如果您尝试滚动以显示隐藏的 div:none;页面加载时,sifr 不会替换该文本。

If you divs that are hidden that you are trying to scroll to have a display:none; on page load, sifr will not replace that text.

墟烟 2024-08-12 13:22:42

每次转换完成后,我使用 jquery 循环选项“after”调用 sIFR 函数:

$(document).ready(function(){
    $('#div').cycle({
        fx: 'fade',
        after: function(){
            sIFR.replace(alberta, {
            selector: '.flash-text',
            wmode: 'transparent'
            });
        }
    });
});

I used the jquery cycle option 'after' to call the sIFR function once each transition is completed:

$(document).ready(function(){
    $('#div').cycle({
        fx: 'fade',
        after: function(){
            sIFR.replace(alberta, {
            selector: '.flash-text',
            wmode: 'transparent'
            });
        }
    });
});
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文