我想从此代码中删除美元符号和网站网址,而又不影响代码的功能... [英] i want to remove the dollar sign and the website url from this code without affecting the functionality of the code...
本文介绍了我想从此代码中删除美元符号和网站网址,而又不影响代码的功能...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<html
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Slideshow With Buttons</title>
<style type="text/css">
ul.ppt {
position: relative;
}
.ppt li {
list-style-type: none;
position: absolute;
top: 0;
left: 0;
}
.ppt img {
border: 1px solid #e7e7e7;
padding: 5px;
background-color: #ececec;
}
</style>
</head>
<body>
<button type="button" id="back">Back</button>
<button type="button" id="stop">Pause</button>
<button type="button" id="play">Play</button>
<button type="button" id="fwd">Forward</button>
<ul class="ppt">
<li><img src="ethernet.jpg" alt="Ethernet Cable"></img></li>
<li><img src="glasses.jpg" alt="Spectacles"></img></li>
<li><img src="pisa.jpg" alt="Leaning Tower of Pisa"></img></li>
</ul>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
$('.ppt li:gt(0)').hide();
$('.ppt li:last').addClass('last');
$('.ppt li:first').addClass('first');
$('#play').hide();
var cur = $('.ppt li:first');
var interval;
$('#fwd').click( function() {
goFwd();
showPause();
} );
$('#back').click( function() {
goBack();
showPause();
} );
$('#stop').click( function() {
stop();
showPlay();
} );
$('#play').click( function() {
start();
showPause();
} );
function goFwd() {
stop();
forward();
start();
}
function goBack() {
stop();
back();
start();
}
function back() {
cur.fadeOut( 1000 );
if ( cur.attr('class') == 'first' )
cur = $('.ppt li:last');
else
cur = cur.prev();
cur.fadeIn( 1000 );
}
function forward() {
cur.fadeOut( 1000 );
if ( cur.attr('class') == 'last' )
cur = $('.ppt li:first');
else
cur = cur.next();
cur.fadeIn( 1000 );
}
function showPause() {
$('#play').hide();
$('#stop').show();
}
function showPlay() {
$('#stop').hide();
$('#play').show();
}
function start() {
interval = setInterval( "forward()", 3000 );
}
function stop() {
clearInterval( interval );
}
$(function() {
start();
} );
</script>
</body>
</html></head>
推荐答案
(' .ppt li:gt(0 )').hide();
('.ppt li:gt(0)').hide();
(' . ppt li:last').addClass(' last');
('.ppt li:last').addClass('last');
(' .ppt li:first').addClass(' 第一');
('.ppt li:first').addClass('first');
这篇关于我想从此代码中删除美元符号和网站网址,而又不影响代码的功能...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文