English 中文(简体)
我的首例 j——我开始在主页上轮换形象?
原标题:my first jquery - where do I start for rotating image on main page?
  • 时间:2012-01-13 16:41:00
  •  标签:
  • jquery

我把“jquery fundamentals”改为“jquery fundamentals”,这似乎是关于开始 o的受欢迎的建议。 I m还是一个业余但较为舒适的用户,即html和cs。 我已经走到支部的网页上,期望我看到一个变化的形象的ug,但该网站说,这一节正在重新开发。

Where should I start? What methods should I consider? As a complete newbie to JS and jquery should I attempt to do this myself or adjust somebody else s work initially?

I m 建造一个简单的网站,主页有一个主要的形象,需要每秒改变,显示大约4或5个图像。

有些人请向我指出正确的方向?

最佳回答

如果你不希望使用一种gin子,但希望与某些法典相邻的我能够实际学习一些东西,这或许有助于你们。 仅代之以<条码>。 第二次:

$(function(){

var elements = $( .home-page-images );
var counter = 0;

if( elements.length > 1 ){
    elements.hide();
    elements.first().show();
    setInterval(function() {
        elements.eq(counter).fadeOut( slow );
         counter++;
         if (counter == elements.length) {
             counter = 0;
         }
        elements.eq(counter).fadeIn(1000);
    }, 5000);
}
})

Mind you, for this to work you will have to output all of your images, position them over one another using CSS. Then JS will take care of the rest.

Also, this will help you to understand how setInterval works: http://www.elated.com/articles/javascript-timers-with-settimeout-and-setinterval/

问题回答

暂无回答




相关问题
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: &...

热门标签