一体化超大型
我运行了这两个脚本。一种是超大尺寸的脚本。另一个脚本用于其他图像的淡入淡出。该脚本的目的是根据列表项上的鼠标悬停行为淡入背景图像。背景图像必须全屏并保持宽高比。问题是淡入的图像不会受到超大脚本的影响。
<script type="text/javascript">
jQuery(function($){
$.supersized({
slides : [{image : '01.jpg', title : '01'},
{image : '02.jpg', title : '02'},
{image : '03.jpg', title : '03'},
{image : '04.jpg', title : '04'},]
});
});
</script>
<script>
$(document).ready(function()
{
function fadeImage (img) {
$("#div").stop(true).animate ({ opacity: 0 }, 'slow', function () {
$(this).css ('background-image', img).animate ({ opacity: 1 }, 'slow');
});
}
var colorOrig="url(01.jpg)";
$("#first").hover(
function() {
fadeImage ('url(02.jpg)');
}, function() {
fadeImage (colorOrig);
});
$("#second").hover(
function() {
fadeImage ('url(03.jpg)');
}, function() {
fadeImage (colorOrig);
});
$("#third").hover(
function() {
fadeImage ('url(04.jpg)');
}, function() {
fadeImage (colorOrig);
});
});
I got these two scripts running. One is a script the works with supersized. The other script is for the fading of the other images. The purpose of the script is to fade in backgroundimages based on mouse over behaviour on list items. The background images have to be full screen and maintain the aspect ratio. The problem is that the images that are fading in don't get effected by the supersized script.
<script type="text/javascript">
jQuery(function($){
$.supersized({
slides : [{image : '01.jpg', title : '01'},
{image : '02.jpg', title : '02'},
{image : '03.jpg', title : '03'},
{image : '04.jpg', title : '04'},]
});
});
</script>
<script>
$(document).ready(function()
{
function fadeImage (img) {
$("#div").stop(true).animate ({ opacity: 0 }, 'slow', function () {
$(this).css ('background-image', img).animate ({ opacity: 1 }, 'slow');
});
}
var colorOrig="url(01.jpg)";
$("#first").hover(
function() {
fadeImage ('url(02.jpg)');
}, function() {
fadeImage (colorOrig);
});
$("#second").hover(
function() {
fadeImage ('url(03.jpg)');
}, function() {
fadeImage (colorOrig);
});
$("#third").hover(
function() {
fadeImage ('url(04.jpg)');
}, function() {
fadeImage (colorOrig);
});
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论