English 中文(简体)
优质循环功能
原标题:jQuery Cycle Plugin dynamic function

努力使这一职能充满活力,而不是静态。

这是一部原有的法典。

$( #goto1 ).click(function(e) {
    e.preventDefault();
    $( #slider ).cycle(1);
});

这里是动态功能(单体工作)。 警惕性输出是正确的,但梯度为周期。

$( .cycle_goto ).live( click , function(e) {
    e.preventDefault();
    var cycle_id = $(this).attr( id ).substr(4);
    alert ( ## +cycle_id+ ## );
    $( #slider ).cycle(cycle_id);
});

传真如下:

<div id="slider">
    <img class="slide" src="<?=FE_URL;?>images/slide1.jpg" style="position: relative !important;" alt="Slide 1.">
    <img class="slide" src="<?=FE_URL;?>images/slide2.jpg" alt="Slide 2">
    <img class="slide" src="<?=FE_URL;?>images/slide3.jpg" alt="Slide 3">
</div>
<div class="slider_nav">
    <ul id="slider_nav_ul">
        <li><a class="cycle_goto" id="goto1" href="#">Hotel &amp; Residence<span class="arrow"><!--  --></span></a></li>
        <li><a class="cycle_goto" id="goto2" href="#">Yacht Charter<span class="arrow"><!--  --></span></a></li>
        <li><a class="cycle_goto" id="goto3" href="#">Properties<span class="arrow"><!--  --></span></a></li>
    </ul>
</div>

http://www.ohchr.org。

采用以下代码,通过将该元素转换成分类:

$( .cycle_goto ).live( click , function(e) {
    e.preventDefault();
    var myString = $(this).attr( id ).substr(4);
    var myInteger;
    myInteger = parseInt(myString);
    var cycle_id = myInteger;
    $( #slider ).cycle(cycle_id);
});
最佳回答

页: 1

综合症为<代码>$(#slideshow );循环(指挥);,因此,你可以选择一个要素。

<><>Edit>:

您可以选择加入一个要素,或选择一组要素,在APIC中修改选择:

slideExpr: null, // expression for selecting slides (if something other than all children is required)

E.g:$ ( #slider ).rix({滑坡节:$ (#slider .child )});

问题回答

暂无回答




相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签