4

背景画像をランダムにフェードインおよびフェードアウトする必要があります。

これは、5 秒に 1 回などの時間指定機能になります。
ASP.NET、Javascript、CSS、または 3 つすべてを使用する必要があります。

ここで私を助けてください。ありがとうございました。

4

3 に答える 3

5

Cycle、jQuery プラグインは非常に柔軟な画像回転ソリューションです: http://malsup.com/jquery/cycle/

于 2008-09-28T20:48:36.983 に答える
2

これが答えです。Googleでもう少し正確な検索を行った後は、気にしないでください。良い解決策を見つけました。

<html>
<head>
<!--
This file retrieved from the JS-Examples archives
http://www.js-examples.com
1000s of free ready to use scripts, tutorials, forums.
Author: Steve S - http://jsmadeeasy.com/ 
-->

<style>
body
{
/*Remove below line to make bgimage NOT fixed*/
background-attachment:fixed;
background-repeat: no-repeat;
/*Use center center in place of 300 200 to center bg image*/
background-position: 300 200;
}
</style>

<script language="JavaScript1.2">
/* you must supply your own immages */
var bgimages=new Array()
bgimages[0]="http://js-examples.com/images/blue_ball0.gif"
bgimages[1]="http://js-examples.com/images/red_ball0.gif"
bgimages[2]="http://js-examples.com/images/green_ball0.gif"

//preload images
var pathToImg=new Array()
for (i=0;i<bgimages.length;i++)
{
  pathToImg[i]=new Image()
  pathToImg[i].src=bgimages[i]
}

var inc=-1

function bgSlide()
{
  if (inc<bgimages.length-1)
    inc++
  else
    inc=0
  document.body.background=pathToImg[inc].src
}

if (document.all||document.getElementById)
  window.onload=new Function('setInterval("bgSlide()",3000)')
</script>

</head>
<body>
<BR><center><a href='http://www.js-examples.com'>JS-Examples.com</a></center> 
</body>
</html>

ここで見つけました

于 2008-09-28T16:12:24.477 に答える
0

CSS 背景画像と jQuery を使用してこれを行う方法に関するチュートリアルが見つかりました...
http://www.marcofolio.net/webdesign/advanced_jquery_background_image_slideshow.html

かなり奥が深いようです。現在進行中のプロジェクトに使用しようとしています。その様子をレポートします。

編集 1

上記の参照された jQuery は、jQuery Cycle プラグインができなかった私の問題に対処したようです。例としてhttp://egdata.com/baf/を見てください。主な問題は、ページ幅が 960px の場合に、スライドショーに幅 1500px のスライドが含まれていたことです。

何らかの理由で、jQuery Cycle プラグインは、現在のスライドを表示するときに幅の css スタイル プロパティを追加します。最初は正しいように見えましたが、ブラウザ ウィンドウのサイズを変更すると失敗します。Cycle はロード時にスライドの幅を設定しているようですが、私の場合、ウィンドウの実際のピクセル幅ではなく、幅を 100% のままにする必要があります。http://egdata.com/baf/index_cycle.html

于 2010-12-01T17:59:58.243 に答える